android - Why does BitmapFactory.decodeResource scale my image? -
i have image 120x120px located in /res/drawable/
directory. size required devices.
to load bitmap, using following:
bitmap tmpbmp = bitmapfactory.decoderesource(getresources(), r.drawable.myimage);
the issue when measure tmpbmp
, size 360x360px. know how scale down 120x120 need, waste of processing time, although minimal.
i assuming has screen densities, since resource in density-less directory.
what reason decoderesource
scaling image? , how stop doing so?
the default drawable
directory assumes images need scaled default mdpi
size. put images in drawable-nodpi
if want disable resource scaling.
do note 120x120px image, if displayed on screen, 3x smaller on xxhdpi device compared mdpi device (as there 3 times many pixels per inch).
Comments
Post a Comment