Troubleshooting guide

2
Using graphics and multimedia
Using images
Use raw images
Using images
Drawing and rendering images
Using audio
Using rich media
Task Steps
Allow applications to
use raw image data.
> To retrieve raw image data from a specified region of a bitmap and store the data in an integer array, invoke
Bitmap.getARGB().
void getARGB(int[] argbData, int offset, int scanLength, int x, int y, int width,
int height);
Retrieve image data. 1. Initialize an integer array.
Bitmap original = Bitmap.getPredefinedBitmap(Bitmap.INFORMATION);
int[] argb = new int[original.getWidth() * original.getHeight()];
2. To store the raw image data of the new or predefined bitmap in the integer array, invoke Bitmap.getARGB().
original.getARGB(argb, 0, original.getWidth(), 0, 0, original.getWidth(),
original.getHeight());
Compare two images to
see if they are identical.
>Invoke Bitmap.equals().
if(restored.equals(original)) {
System.out.println("Success! Bitmap renders correctly with RGB data.");
} else if(!restored.equals(original)) {
System.out.println("Bitmap rendered incorrectly with RGB data.");
}