I'm trying to load a image, for the purpose of debugging I've made the
image a solid grey #494949.
I load it with the following code
inputstream =
context.getResources().openRawResource(R.drawable.level1_heightmap);
level1_heightmap = BitmapFactory.decodeStream(inputstream);
Although when I run getpixel on the image it does not give a uniform
value, I put this debugging code in to confirm
for (int i=0;i<100;i++)
{
Log.d("Debug", "COLOR"+level1_heightmap.getPixel((int)
(Math.random()*level1_heightmap.getWidth()),(int)
(Math.random()*level1_heightmap.getWidth())));
}
Which outputs the following colors
COLOR-11908790 and COLOR 11383470
Considering the image is a solid grey, shouldn't it just be outputting
one number? Is there 2 levels of loading for BitmapFactory and how do
I ensure that the image is fully loaded before working with it?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en