Creating a PorterDuff XferMode

suggest change

An Xfermode (think “transfer” mode) is a transfer step in the drawing pipeline. When an Xfermode is applied to a Paint, the pixels drawn with the paint are combined with the underlying pixels (already drawn) according to the mode:

paint.setColor(Color.BLUE);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));

Now we have a blue tint paint. Any shape drawn will tint the already existing, non-transparent pixels blue in the area of the shape.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents