Reputation: 1099
I've seen this code on the web:
Bitmap grayscaleBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
Canvas c = new Canvas(grayscaleBitmap);
Paint p = new Paint();
ColorMatrix cm = new ColorMatrix();
cm.setSaturation(0);
ColorMatrixColorFilter filter = new ColorMatrixColorFilter(cm);
p.setColorFilter(filter);
c.drawBitmap(bmp, 0, 0, p);
My questions are: 1. Is 'bmp' supposed to be the color bitmap I want to affect? 2. How do I get the 0-255 value of the grayscale?
Thanks.
Upvotes: 1
Views: 1249
Reputation: 17081
Upvotes: 2