Create bitmap mask programatically
<p>I have an awful feeling this is stupidly easy, but I can't figure it out.</p>

<p>It's also not easy to describe, but here goes.  I have this code in onDraw().</p>

<pre><code>radius = drawGmpImage(this.gmpImage, canvas);
canvas.drawCircle(kHorizontalOffset, kScreenVerticalOffset, radius , maskPaint);
</code></pre>

<p>drawGmpImage creates a complex graphic which is a circle with many lines drawn on it.  It's a library function which I cannot change.  The lines are polygons and can extend beyond the circumference of the circle.  </p>

<p>The need is to "blank out" everything drawn outside the circle.  </p>

<p>This is a port from iOS and the original developers solution is to use a simple bitmap mask, stored as a resource, with a transparent circle which matches the size of the circle drawn.  Simply drawing the bitmap over the drawn circle has the desired effect but is not an option on Android as I need to support all possible resolutions and ratios.</p>

<p>Therefore, the canvas.drawCircle() call is the beginning of my attempt to mask out everything outside the circle.  It works fine in that a filled circle is drawn over my drawn circle so that the only thing left are the polygon lines outside the drawn circles circumference.  Radius is the radius of the drawn circle.</p>

<p>How can I invert this so that I am left with the contents of the circle?</p>
