Book Image

LiveCode Mobile Development Cookbook

By : Dr. Edward Lavieri
Book Image

LiveCode Mobile Development Cookbook

By: Dr. Edward Lavieri

Overview of this book

Table of Contents (17 chapters)
LiveCode Mobile Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  1. 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 value 200 should be replaced with the actual height (in pixels) that you want the image to have.

  2. 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 value 250 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...