porter-duff

PorterDuff masking leaves opaque black background

I'm trying to mask a FrameLayout with a mask defined as a nine patch. However, although it works fine on 5.0+ on older versions (such as 4.4.4), the patch leaves an opaque black background. Is there anything that can be done to avoid this other than drawing to an off screen bitmap before rendering...

Draw a transparent circle onto a filled android canvas

I am trying to do something very simple (see above). I want all of the pixels of a canvas to be a solid color, except for the the pixels that fill a centered circle. I have read hundreds stack overflow post on this subject and have tried hundreds of things including setting the PorterDuff.Mode. Here...

Punch a hole in a rectangle overlay with HW acceleration enabled on View

I have a view which does some basic drawing. After this I want to draw a rectangle with a hole punched in so that only a region of the previous drawing is visible. And I'd like to do this with hardware acceleration enabled for my view for best performance. Currently I have two methods that work, but...

How to create a 'transparent circle inside rectangle' shape in XML in Android?

I'm trying to create the following design in my app. Design Mockup Its an overlay on top of the main UI. Trying to create this using a layout on top of the main UI with its background as a translucent shape created in XML. However, even after reading multiple posts, I'm not able to figure it out. I...

What does PorterDuff.Mode mean in android graphics.What does it do?

I would like to know what PorterDuff.Mode means in android graphics. I know that it is a transfer mode . I also know, that it has attributes such as DST_IN, Multiply etc. Phasmal Here's an excellent article with illustrations by a Google engineer: http://ssp.impulsetrain.com/porterduff.html...