Skip to content

Instantly share code, notes, and snippets.

@jibbo
Created October 30, 2014 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jibbo/20faef467837746bdb89 to your computer and use it in GitHub Desktop.
Save jibbo/20faef467837746bdb89 to your computer and use it in GitHub Desktop.
How to set a Painter to erase content on a canvas.
Paint e = new Paint();
e.setColor(Color.TRANSPARENT);
e.setAlpha(0);
e.setAntiAlias(true);
e.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment