Note that there are some explanatory texts on larger screens.

plurals
  1. POShape overlay ("inverse path") on ImageView
    text
    copied!<p>I have a problem: I would like to draw a grey overlay on an image. There is a path and I would like to colour <em>outside</em> of the path. Clipping is not good, because the edges are not anti-aliased (and I have to make it work on 2.1).</p> <p>I have made it work on camera (right side). There is a FrameLayout, holding a SurfaceView (camera preview) and a View over it. The view fills the overlay color on full canvas, then with xfermode deletes the paths (Mode.CLEAR).</p> <p>Using the same method I get the picture on the right. First I made my View an ImageView descendant, but that was completely bad. Then, I added an ImageView with the image below my view (like the camera preview), but the same result. Then Used other imageview out of the framelayout, but same. Of course, I always tried to set the bgcolor to transparent, draw Color.TRANSPARENT, but it didn't work. I don't know what is the problem. Maybe Mode.CLEAR clears the whole screen on that area? Why it is working with camera surfaceview and not with and imageview (or even another surfaceview)?</p> <p>I have been googling for 7 hours, and no real solutions. Can you please help me what I am doing bad, and share some "tricks"? As I said before, I need anti-aliased edges (severals shapes have many curves and diagonals), so I cannot clip (not even if drawing strokes, its awful).</p> <p>Thank you in advance.</p> <p>Figure: <a href="http://s16.postimage.org/72bcp5kad/img_overlay.jpg" rel="nofollow">http://s16.postimage.org/72bcp5kad/img_overlay.jpg</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload