Code example for Canvas

Methods: drawBitmap, setBitmap

0
                final Bitmap thumb = Bitmap.createBitmap(sIconWidth, sIconHeight, c);
                final Canvas canvas = sCanvas;
                final Paint paint = sPaint;
                canvas.setBitmap(thumb);
                paint.setDither(false);
                paint.setFilterBitmap(true);
                canvas.drawBitmap(bitmap, (sIconWidth - bitmapWidth) / 2,
                        (sIconHeight - bitmapHeight) / 2, paint);
                return thumb;
            } 
        } 
 
        return bitmap;
    } 
    /** 
     *  ADW Create an icon drawable with reflection :P 
     *  Thanks to http://www.inter-fuser.com/2009/12/android-reflections-with-bitmaps.html 
     * @param icon 
     * @param context 
     * @return 
     */