Before getting to useful examples, let's make a getPixel
function to obtain the color components of a point in the image and then complete a quick test case. The following steps will help you in this process:
Make a new Mainstack. Click on Save to save it as ImageDataTests.
Set the stack's resolution to the size of your largest test device or just try 1024 x 768 if you'll be using the iPad Simulator.
From the File menu, navigate to Import as Control | Image and select any small image file you have, to place it in the upper-left corner of the card window. The next example, uses a LiveCode logo image that can easily be obtained from any LiveCode web page.
Place a new
Graphic
object next to the image. It's going to show a single color, so just make it big enough so that you can easily see the color. Name itswatch
.Set graphics to default...