Search code examples
androidporter-duff

Can't use paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN)); in android


I'm making a reflection effect in my image but I can't use this line

 paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));

there is a red line is "DST_IN" saying it cannot be resolved or is not a field. How does anyone can use it except me? Is there any plugin or etc to use that line? I tried to search it but I can't find any ways to use it.

Any thoughts will be highly appreciated.


Solution

  • Solved:

    just change it into this

    paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));