diff options
-rw-r--r-- | src/com/android/bitmap/drawable/BasicBitmapDrawable.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/bitmap/drawable/BasicBitmapDrawable.java b/src/com/android/bitmap/drawable/BasicBitmapDrawable.java index 53ab38d..f9d39a3 100644 --- a/src/com/android/bitmap/drawable/BasicBitmapDrawable.java +++ b/src/com/android/bitmap/drawable/BasicBitmapDrawable.java @@ -281,11 +281,19 @@ public class BasicBitmapDrawable extends Drawable implements DecodeCallback, // Rotate the canvas. canvas.save(); canvas.rotate(orientation, bounds.centerX(), bounds.centerY()); - canvas.drawBitmap(mBitmap.bmp, sRect, rotatedBounds, mPaint); + drawBitmap(canvas, rotatedBounds); canvas.restore(); } } + /** + * Override this method to customize how to draw the bitmap to the canvas for the given bounds. + * The bitmap to be drawn can be found at {@link #getBitmap()}. + */ + protected void drawBitmap(final Canvas canvas, final Rect bounds) { + canvas.drawBitmap(mBitmap.bmp, sRect, bounds, mPaint); + } + @Override public void setAlpha(int alpha) { final int old = mPaint.getAlpha(); |