webMethods Mobile Suite  | 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);

Copyright © 2010-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.