How do I import and set images based upon their width and height?

William de Smet williamdesmet at gmail.com
Wed Jan 28 05:07:09 EST 2009


Hi there,
I am trying to import images and put them into their own 'dummyimage'  based
upon their width and height.
The 'dummyimages' are called Photo and Photo2.
It doesn't work!
Can someone help me with this one?

*on* mouseUp

   *put* empty into img "Photo"

  *put* empty into img "Photo2"

  *answer* file "Choose a photo:"

  *if* it = empty

  *then* *exit* mouseUp

  *put* url ("binfile:" & it) into tPhoto

  *put* the width of the last image into tWidth

  *put* the height of the last image into tHeight

  *if* tWidth <= tHeight

  *then* *put* tPhoto into img "Photo2"

  *if* tWidth >= tHeight

  *then* *put* tPhoto into img "Photo"
*end* mouseUp

Thanks!

Greetings,

William (from a very cold Holland)



More information about the use-livecode mailing list