Hey all!
I'm working with Android and I really need a fast way to get a bitmap of a predetermined size to be filled with a predetermined colour.
The following code is not working for me however;
Bitmap input is a mutable bitmap
int old = input.getPixel(0, 0);
Canvas c = new Canvas(input);
Rect rect = c.getClipBounds(); // The dimensions of the bitmap are returned
c.drawARGB(a, r, g, b);
int n = input.getPixel(0, 0);
if(old==n)
Log.e(TAG, "Values didn't change!");
return input;
Rest assured, the 'old' value and the value of (a|r|g|b) are different but having 'drawn' the colour using a canvas with my mutable bitmap underneath, the bitmap retains it's old value.
I'd be happy with any method that takes a bitmap and a colour value and returns a bitmap filled with that colour.
Kind regards,
Gav