Code example for Canvas

Methods: scalesetBitmap

    private static void renderDrawableToBitmap( 
            Drawable d, Bitmap bitmap, int x, int y, int w, int h,
            float scale) {
        if (bitmap != null) {
            Canvas c = new Canvas(bitmap);
            c.scale(scale, scale);
            Rect oldBounds = d.copyBounds();
            d.setBounds(x, y, x + w, y + h);
            d.setBounds(oldBounds); // Restore the bounds
Stop searching for code, let great code find you!  Add Codota to your java IDE