Creating an ImageView with a mask
<p>I followed some other questions on the topic, and also API demos on XferModes, and attempted to create an ImageView that masks its content according to an alpha mask.
The alpha bitmap contains 0 alpha for areas to be hidden and 255 alpha for areas to be shown.</p>

<p>This is the onDraw code:</p>

<pre><code>@Override
protected void onDraw(Canvas canvas)
{
    super.onDraw(canvas);

    Paint paint = new Paint();
    paint.setFilterBitmap(false);
    paint.setXfermode(new PorterDuffXfermode(Mode.DST_IN));

    canvas.drawBitmap(mMaskBitmap, 0, 0, paint);
    paint.setXfermode(null);
</code></pre>

<p>It doesn't work for me. If I put SRC_IN, the mask just gets drawn on top. If I put DST IN, I just see the original image.</p>

<p>Any advice?</p>
