Android Bitmap(s): strange behaviour with alpha channel
<p>Ok, can somebody help me understand why:</p>

<pre><code>protected void onDraw(Canvas canvas) {          
    Paint paint = new Paint();
        paint.setDither(false);
        paint.setShader( new BitmapShader( bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP) );
        canvas.drawBitmap( bitmap.extractAlpha(),0,0, paint);
}
</code></pre>

<p>Where bitmap is an ARGB_8888 Bitmap filled with an image having some pixels set to opaque (a = 0xff) and some pixels transparent (a = 0x00).</p>

<p>The above code works, i can see the bitmap with the proper transparent area not drawn.</p>

<p>The following code, instead, does NOT work: the entire bitmap is always drawn ignoring alpha components?</p>

<pre><code>protected void onDraw(Canvas canvas) {
    Paint paint = new Paint();
        paint.setDither(false);
        paint.setXFermode( new PorterDuffXFerMode( PorterDuff.Mode.SRC_ATOP );
        canvas.drawBitmap( bitmap,
                               0,
                               0, paint);
}
</code></pre>
