How to clip and fill a canvas using an alpha mask
<p>I have some .png icons that are alpha masks. I need to render them as an drawable image using the Android SDK.</p>

<p>On the iPhone, I use the following to get this result, converting the "image" alpha mask to the 'imageMasked' image using black as a fill:</p>

<pre><code>CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(NULL, thumbWidth, 
    thumbHeight, 8, 4*thumbWidth, colorSpace, kCGImageAlphaPremultipliedFirst);
CGRect frame = CGRectMake(0,0,thumbWidth,thumbHeight);
CGContextClipToMask(context, frame, [image CGImage]);
CGContextFillRect(context, frame);

CGImageRef imageMasked = CGBitmapContextCreateImage(context);
CGContextRelease(context);
</code></pre>

<p>How do I accomplish the above in Android SDK?</p>

<p>I've started to write the following:</p>

<pre><code>Drawable image = myPngImage;

final int width = image.getMinimumWidth();
final int height = image.getMinimumHeight();

Bitmap imageMasked = Bitmap.createBitmap(width,
    height, Config.ARGB_8888);
Canvas canvas = new Canvas(iconMasked);
image.draw(canvas); ???
</code></pre>

<p>I'm not finding how to do the clipping on imageMasked using image. </p>
