Code example for PaintFlagsDrawFilter

        private final Rect mOldBounds = new Rect();
        private Canvas mCanvas = new Canvas();
        public IconResizer(Context context) {
            mCanvas.setDrawFilter(new PaintFlagsDrawFilter(Paint.DITHER_FLAG,
            final Resources resources = context.getResources();
            mIconWidth = mIconHeight = (int) resources.getDimension(
         * Returns a Drawable representing the thumbnail of the specified Drawable. 
         * The size of the thumbnail is defined by the dimension 
         * android.R.dimen.launcher_application_icon_size. 
         * This method is not thread-safe and should be invoked on the UI thread only. 
         * @param icon The icon to get a thumbnail of.