Resizing an image
Resizing images can be a useful utility in some mobile apps. This is especially important if your app allows the user to capture or import images. This recipe will show you how to resize an image in a mobile app.
How to do it...
Follow the steps in this recipe to resize an image using the LiveCode script:
To adjust the height of an image, enter the following code:
set the height of img "myPhoto" to 200
Note, that
myPhoto
should be the name of your actual image. Also, the value200
should be replaced with the actual height (in pixels) that you want the image to have.To adjust the width of an image, enter the following code:
set the width of img "myPhoto" to 250
Note, that
myPhoto
should be the name of your actual image. Also, the value250
should be replaced with the actual width (in pixels) that you want the image to have.
How it works...
LiveCode makes resizing images very easy. We simply need to set the height
and width
properties to have the image resized.
There's more...
When...