how to manage height width of image comes from bitmap?

15 views Asked by At

In my project I used ImageView to show a profile photo which I got from my database in the form of BASE64 and I stored it in the internal storage. Data arrives normally without error and BASE64 also converted. My problem is that I can't set the height and width of the photo.

Bitmap originalBitmap = BitmapFactory.decodeFile(imageFilePath);
int desiredWidth=130;
int desiredHeight=130;
Bitmap scaledBitmap = Bitmap.createScaledBitmap(originalBitmap, desiredWidth, desiredHeight, true);
photo.setImageBitmap(scaledBitmap);
0

There are 0 answers