Ajay S
Ajay S

Reputation: 48612

Fit the large image into small imageview with as good quality as the original image?

Hello I am working on one good android app where I need to fit the large bitmap into small size imageview. I am using imageview of size 300dp X 300dp to display large image 1024 X 780

How can I make the large image into small with as good quality as the original image ?

Upvotes: 7

Views: 4795

Answers (2)

Ajay S
Ajay S

Reputation: 48612

@Nikola comment answered to my question. I am writing this in the answer so that it would good for future readers

You should make a Thumbnail image of size 300x300 but preserving its aspect ratio. You can draw larger images on a canvas centered with some color filling the rest of the space.

Upvotes: 0

iamkristher
iamkristher

Reputation: 408

Did you try im.setScaleType(ScaleType.FIT_XY)

Upvotes: 0

Related Questions