Firstly I am aware of the recommended approach of using inJustDecodeBounds
and inSample
size to load bitmaps at a size close to the desired size. This is however a fairly broad approach that only gets an image approximate to the target.
I have though of utilising options.inDensity
and options.inTargetDensity
to trick the native loader into scaling an image more precisely to the desired target size. Basically I set options.inDensity
to the actual width of the image and options.inTargetDensity
to the desired width and I do indeed get an image at the desired size (aspect ration happens to remain the same in this case). I then set image.setDensity(DENSITY_NONE)
on the resulting image and all appears to work OK.
Anyone know of anything wrong with this approach? Any thoughts on memory efficiency and image quality?