문제

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.

도움이 되었습니까?

해결책

I've done it like that:

BitmapFactory.Options options = new BitmapFactory.Options();
  options.inSampleSize = 10;
  mPhoto = BitmapFactory.decodeFile(mUri.getPath(), options);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top