- mPaint = new Paint();
- mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SCREEN));
常见的Xfermode(SRC为原图,DST为目标图),把代码中的SRC_IN换成下图指定的模式就会出现对应的效果图。
- Canvas canvas = new Canvas(Src);
- paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
- canvas.drawBitmap(Dst, 0f, 0f, paint);