Mobile Development 10.11 | webMethods Mobile SuiteWeb Help | Using webMethods Mobile Designer | Creating Mobile Application Projects | Coding a Mobile Application | Image Caching | Copying an Image for Drawing
 
Copying an Image for Drawing
In most cases, caching images is preferable. But if you want to alter a single instance of an image that was created by an Image.loadImage() call, you should copy it to a separate instance of the image before. This is shown in the following example that uses the non-null image "oldImage".
//AARRGGBB data
int[] imageData = new int[oldImage.getWidth() * oldImage.getHeight()];
oldImage.getRGB(imageData, 0, oldImage.getWidth(), 0, 0, oldImage.getWidth(),
oldImage.getHeight());
Image newImage = Image.createRGBImage(imageData, oldImage.getWidth(),
oldImage.getHeight(), true);