I have a bitmap which I am creating like so…..
myBitmap=BitmapFactory.decodeResource(res, R.drawable.picture, options);
I’m then scaling it using Bitmap.createScaledBitmap
then when I’m drawing it I’m re-colouring it like this:
c.drawBitmap(myScaledBitmap, 0, 0, myPaint);
This works, but performance takes a huge hit as I’m re-colouring in realtime.
What I’m now trying to do is create a different colour bitmap before the loop starts running, I thought this would be quite a simple thing to do, but I can’t work it out and would appreciate any pointers.
The only other way would be for me to actually create different .png’s to start with but that would be a bit of a pain so there must be a way to do this in code? Thanks.
It isn’t too complicated. You have most of it. Outside your loop, you can almost just use the code you already have. I think something like this should work:
Now just use
coloredBitmapin the loop.