Skip to content

Instantly share code, notes, and snippets.

@gaeeyo
Created January 16, 2014 11:26
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 gaeeyo/8453375 to your computer and use it in GitHub Desktop.
Save gaeeyo/8453375 to your computer and use it in GitHub Desktop.
穴の空いたオーバーレイ
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
canvas.saveLayer(null, paint,
Canvas.HAS_ALPHA_LAYER_SAVE_FLAG
| Canvas.CLIP_TO_LAYER_SAVE_FLAG);
canvas.drawColor(0x88000000);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
canvas.drawCircle(getWidth()/2, getHeight()/2, getWidth()/2, paint);
canvas.restore();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment