From 0055102404c767af2cd5fabf70acbc8317e33fe3 Mon Sep 17 00:00:00 2001 From: Victor Doba Date: Wed, 20 Mar 2013 11:24:21 +0100 Subject: Method added to load scaled resource (with only alpha channel). Change-Id: I1b9a58e0fd4c33c9748ad03f53d635c426a5102c --- src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java index 499170a35..338cf51cd 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java @@ -169,13 +169,14 @@ public abstract class ImageFilterRS extends ImageFilter { return bitmapAlloc; } - public Allocation loadResourceAlpha(int resource) { + public Allocation loadScaledResourceAlpha(int resource, int inSampleSize) { Resources res = null; synchronized(ImageFilterRS.class) { res = sRS.getApplicationContext().getResources(); } final BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ALPHA_8; + options.inSampleSize = inSampleSize; Bitmap bitmap = BitmapFactory.decodeResource( res, resource, options); @@ -184,6 +185,10 @@ public abstract class ImageFilterRS extends ImageFilter { return ret; } + public Allocation loadResourceAlpha(int resource) { + return loadScaledResourceAlpha(resource, 1); + } + public Allocation loadResource(int resource) { Resources res = null; synchronized(ImageFilterRS.class) { -- cgit v1.2.3