Hi, did you look on this Exmaple? http://code.google.com/intl/ru/android/samples/ApiDemos/src/com/example/android/apis/graphics/CreateBitmap.html
And point what many Bitmap constructors return an immutable class. Sorry for my poor English, hope this message will help You. Sergey G. Lysenko On 17 дек, 06:05, Gav <[email protected]> wrote: > Hi, > > So the code above never actually gets the pixels of the orignial image > hence my woes. Pretty ridiculous error but hey, it's late and nearly > Christmas! > > Anyway, I'd still be interested if anyone has an ideal for an optimal > implementation of inverse. I'd also like to learn more about the > Config enum. > > Many thanks, > > Gavin > > On Dec 16, 11:51 pm, Gav <[email protected]> wrote: > > > Hey! > > > I am looking to make custom filters which manipulate the pixels of a > >Bitmap. Before I can start I need to read up more on the Configs and > > how they are encoded in thebitmap. I like to use examples so here's > > my Inverse function; > > > publicBitmapinvert(finalBitmapd) { > > int index, r, g, b; > > int picw = d.getWidth(); > > int pich = d.getHeight(); > > > int[] pix = new int[picw * pich]; > > > for (int y = 0; y < pich; y++){ > > for (int x = 0; x < picw; x++) { > > > index = y * picw + x; > > r = 255 - ((pix[index] >> 16) & 0xff); > > g = 255 - ((pix[index] >> 8) & 0xff); > > b = 255 - (pix[index] & 0xff); > > > pix[index] = 0xff000000 | (r << 16) | (g << > > 8) | b; > > } > > } > > > returnBitmap.createBitmap(pix, picw, pich, d.getConfig()); > > > Thebitmapreturned is a white out which leads me to believe that my > > assumption about the encoding of the RGB values is wrong. Upon further > > investigation I found that the image could be any of the following > > configs; > > > ALPHA_8 > > ARGB_4444 > > ARGB_8888 > > RGB_565 > > > Which I would like to learn more about, can anyone point me in the > > direction of an explanation of how these encodings work? I was wary of > > material I found as it might not be the same standard Google uses. > > > If you can recommend a better way of inverting aBitmapthe > > information would also be of substantial benefit for me. > > > Many thanks, any help or comments would be greatly appreciated! > > > Gav --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" 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-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

