I am trying to port some code from a regular Java program into the Android platform. Unfortunately, a significant part of the program involves manipulating images, and Java’s AWT was taken away from me. I am trying to replace awt.BufferedImage with Bitmap, and was hoping that the only differences between the two classes would be their interfaces. I read some of the documentation, and it looked like that is true, but after wrapping all of the image stuff into a nice little class and testing almost-the-same code on both my development machine and an actual phone, one program works and the other does not. So:
The encoding for color does not change – right? It is still 0xAARRGGBB – right?
The images themselves are not changed – right? When I put an image into res/drawable, it is exactly the same image. Most notably, they don’t alter the resolution in any way – right?
Accessing the pixels is essentially the same – right? I essentially replaced all of my get/setRGB(x,y,RGB) with get/setPixel(x,y,color). There are no changes to the method of indexing into the grid – is there?
Solved: when opening the image, I failed to create a
BitmapFactory.Options()withinDitherset to false. TheBitmapFactorythen failed to produce an exact copy, putting some alterations in the resultingBitmapin order to make it more pleasing for display.