In short I have a bitmap image and need to access all the pixels to use the RGB for an image processing algorithm. When I use the dimensions from getHeight()/getWidth() in my for loops to cycle through the image and use getPixel(x,y) I get an out of bounds error and the app crashes. By trail and error I found that with an image of dimensions 480,320(from getWidth()/getHeight()), I could only access approximately the first 200,100 pixels. I set the methods to only get these pixels, do the processing and then use setPixel() to create a binary image. When I display this I get the bitmap with a square of processed pixels in the top left corner, the 200,100 pixels and the remainder is normal. The rest of the pixels are obviously there because I can display the image normally and the results of getting the dimensions is right but I am unable to access over half of the pixels.
The bitmap data is from the native camera app, using an intent from my activity. The data is definitely a bitmap as I can do the usual methods to it, such as getWidth() etc. and can display it normally. I also tried this with a bitmap file in my res/drawable folder and the same thing happened. People I have spoken to have also had this problem and have simply given up making such apps. Is this a known bug and has any got any ideas as to a workaround. I have researched this online but not found anything. Many thanks in advance, this is also posted on http://stackoverflow.com/questions/4233339/how-to-access-pixels-of-a-bitmap-image-on-android -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en