I call the C ++ function on the JNI and pass the RGBA_8888 bitmap, lock it, change the values, unlock, return, and then show in Java with this C ++ code:
AndroidBitmap_getInfo(env, map, &info) < 0); AndroidBitmap_lockPixels(env, map, (void**)&pixel); for(i=info.width*info.height-1;i>=0;i--) { pixel[i] = 0xf1f1f1f1; } AndroidBitmap_unlockPixels(env, map);
The problem is that the bitmap images do not look the way I expect and the pixel values ββ(verified with getPixel) do not match when I test them in Java from what I installed in C ++. When I set the bitmap values ββto 0xffffffff, I get the correct value in Java, but for many others I do not. For example, 0xf1f1f1f1 turns into 0xF1FFFFFF.
What do I need to do to make it work?
PS: I am using Android 2.3.4
source share