I'm trying to apply a gradient mask to a blur layer in Android. Something like this:
I'm trying using this code:
Bitmap mutable = Bitmap.createBitmap(lebg.getWidth(), lebg.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(mutable);
Paint paint = new Paint();
paint.setFilterBitmap(false);
canvas.drawBitmap(lebg, 0, 0, paint);
canvas.drawBitmap(leblur, 0, 0, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.DST_OUT));
canvas.drawBitmap(mask, 0, 0, paint);
Any idea?
Thanks!
The first image is the blur layer. The second image is the original layer. The third image is the mask layer. The last image is the result image.