Code example for Closeable

Methods: close

     * Creates a mutable bitmap from subset of source bitmap, transformed by the optional matrix. 
    private static Bitmap createBitmap(
            Bitmap source, int x, int y, int width, int height, Matrix m) {
        // Re-implement Bitmap createBitmap() to always return a mutable bitmap. 
        Canvas canvas = new Canvas();
        Bitmap bitmap;
        Paint paint;
        if ((m == null) || m.isIdentity()) {
            bitmap = Bitmap.createBitmap(width, height, source.getConfig());
            paint = null;
        } else { 
            RectF rect = new RectF(0, 0, width, height);
            bitmap = Bitmap.createBitmap(
                    Math.round(rect.width()), Math.round(rect.height()), source.getConfig());