Skip to content Skip to sidebar Skip to footer

Downloaded Image Gets Resized

I am downloading an image from the internet which has the following dimensions: 128px x 128px After the download the image is used as the background of an ImageButton but when the

Solution 1:

I've had this problem before, instead of using the BitmapFactories decode method - try the using the Drawable class e.g.

URLurl=newURL("some address");
URLConnectionconnection= url.openConnection();
Drawabled= Drawable.createFromStream(connection.getInputStream(),"src");

Hope this helps!

Solution 2:

Solution 3:

If you know in advance that the image you are going to set is 128x128 size then set the layout_width and layout_height of the ImageView to 128px.

Post a Comment for "Downloaded Image Gets Resized"