0

I am new to Android application development.

I have large image file set into small fixed size ImageView but it is not display properly. It appears blurred and not clearly visible. Below is my code.

Thanks in advance.

Patel Hiren
  • 61
  • 11

1 Answers1

0

You can resize image bitmap using below code.

Bitmap <Your image bitmap>;
int height = (bitmap.getHeight() * 512 / bitmap.getWidth());
Bitmap scale = Bitmap.createScaledBitmap(bitmap, 512,height, true);
iv_signature.setImageBitmap(scale);

And also set android:scaleType="fitXY" in layout xml file for display complete image.

Chirag Savsani
  • 6,020
  • 4
  • 38
  • 74