I want to re size bitmap image… so for that I am using below code
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
bmOptions.inJustDecodeBounds = true;
int photoW = bmOptions.outWidth;
int photoH = bmOptions.outHeight;
int scaleFactor = Math.min(photoW / 100, photoH / 100);
bmOptions.inJustDecodeBounds = false;
bmOptions.inSampleSize = scaleFactor;
bmOptions.inPurgeable = true;
Bitmap bitmap = BitmapFactory.decodeFile(path, bmOptions);
but my problem is that i am getting image from drawable folder like this
Bitmap icon = BitmapFactory.decodeResource(getResources(),
Const.template[arg2]);
so how can i convert this things into file path so i can set in the following line
Bitmap bitmap = BitmapFactory.decodeFile(path, bmOptions);
and can get resizable image
I don’t get it, why do you want to use
decodeFile()? I’m pretty sure you can useDocs