Domanda

Ive got this piece of code but it works only when the user has to choose the picture from the gallery:

BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 2;                  
mPhoto = BitmapFactory.decodeFile(path, options);
image.setImageBitmap(mPhoto);

So I have a bitmap file, mPhoto. It has an image in it.

I need to apply the options on that photo.

How can I do that?

Ty.

È stato utile?

Soluzione

I've done it like that:

BitmapFactory.Options options = new BitmapFactory.Options();
  options.inSampleSize = 10;
  mPhoto = BitmapFactory.decodeFile(mUri.getPath(), options);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top