0

I currently have a custom view whose color is set using the following,

canvas.drawColor(Color.RED);

What I would like to do a punch a "hole" in the now red background or essentially fill that hole with a transparent color. I would also like to invert this as well to my choosing. If anyone can shed some light on this topic, much would be appreciated. I've looked at this post erase bitmap but it seems overkill for what I'm trying to do here.

Community
  • 1
  • 1
serveace6
  • 87
  • 1
  • 7
  • The code in the following link should help you, http://stackoverflow.com/questions/8665064/canvas-motion-draw-circle/8665396#8665396 – Deepak Dec 29 '11 at 08:36

1 Answers1

0

Have a look at the Xfermode graphics sample from Android.

This blog post has an example that uses the canvas.drawColor, but on top of an existing bitmap.

SoftWyer
  • 1,986
  • 28
  • 33