On the fly bitmap editing in Android
I'm creating a scene for a game.
There's a background which is a bitmap and player objects. I want to have the player objects to be able to "eat" away at the background with a transparent color as they move around the board. Basically if an object is at a certain point a circle around that开发者_Go百科 object is alpha'ed out of the bitmap. The edits of the bitmap need to persist.
What's the best way to accomplish this? I was thinking of modifying the pixels for the bitmap using Bitmap.setPixel but that would probably be very expensive.
I figured it out. I need to basically use Canvas's draw functions which are applied to a bitmap. IE Canvas.drawBitmap()
精彩评论