Code example for PaintFlagsDrawFilter

final class Utilities { 
    private static int sIconWidth = -1;
    private static int sIconHeight = -1;
    private static final Paint sPaint = new Paint();
    private static final Rect sBounds = new Rect();
    private static final Rect sOldBounds = new Rect();
    private static Canvas sCanvas = new Canvas();
    static { 
        sCanvas.setDrawFilter(new PaintFlagsDrawFilter(Paint.DITHER_FLAG,
     * 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. 
Contextual code suggestions in your IDE  Get Codota for Java