I have successfully applied the Universal Image Loader library (version 1.8.3) to my application, and I am trying to resize the image before displaying it in the gridview element (because sometimes the image is too large to cache in memory.)
Here is what I am trying:
... BitmapFactory.Options resizeOptions = new BitmapFactory.Options(); resizeOptions.inSampleSize = 3; // decrease size 3 times resizeOptions.inScaled = true; options = new DisplayImageOptions.Builder() .showStubImage(R.drawable.blank) .showImageForEmptyUri(R.drawable.no_image) .cacheInMemory() .cacheOnDisc() .decodingOptions(resizeOptions) .build(); ...
This code does not make the image 3 times smaller for any reason.
Does anyone have a better way to resize an image with exactly the specified density?
John f
source share