Another approach is to draw in transparent color on the canvas (holes for drawing). Bitmap needs an alpha channel.
//Set transparent paint - you need all of these three Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_OUT)); paint.setColor(Color.TRANSPARENT); // Do you wanna soften? // Set paint transparency: // 0 = transparent ink, no visible effect // 255 = full ink, hole in the bitmap p.setAlpha(192); // Do you want some blur? // Set blur radius in pixel paint.setMaskFilter(new BlurMaskFilter(10, Blur.NORMAL));
source share