How do I import and set images based upon their width and height?
Terry Judd
tsj at unimelb.edu.au
Wed Jan 28 05:12:46 EST 2009
Hi William - try setting the filename of a dummy (offscreen) image and then
querying its formattedwidth and formattedheight to get the actual image
dimensions. You should be able to take it from there.
Regards,
Terry...
On 28/01/09 9:07 PM, "William de Smet" <williamdesmet at gmail.com> wrote:
> 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)
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list