On an 'image object': Is there a direct way -a property or anything- to reset to the original image size (width and height) after enlarging or reducing it?
The only way I have found is to reload the image again (image’s fileName property).
Thanks in advance.
Restoring the size of a image object.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 9444
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Restoring the size of a image object.
The 'sensible' thing to do is store an image's original dimensions somewhere permanent
before resizing it.
-
before resizing it.
-
- Attachments
-
- PC RESIZER.livecode.zip
- Unfinished stack.
- (29.63 KiB) Downloaded 213 times
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Restoring the size of a image object.
Hi Fermin,
You may use formattedWidth and formattedHeight.
Something like this:
Best regards
Jean-Marc
You may use formattedWidth and formattedHeight.
Something like this:
Code: Select all
...
lock screen
put the loc of img 1 into tLoc
set the width of img 1 to (the formattedWidth of img 1)
set the height of img 1 to (the formattedheight of img 1)
set the loc of img 1 to tLoc
...
Jean-Marc
https://alternatic.ch
Re: Restoring the size of a image object.
Great, I had used formattedWidth for text fields but I hadn't thought of using it for images. Thank you very much...