tags:

views:

39

answers:

1

Hello all,

I have problem with displaying bitmap image on imageview on high density screen (480x800). When the bitmap image loaded from file on sdcard, the image does not scale to fit hdpi screen. On medium density screen it works normal (320x480).

public static Bitmap getBitmapFromFile(String src) {
    File file = new File(src);

    if (file.exists()) {
        return BitmapFactory.decodeFile(src);
    }

    return null; 
} 

mImage.setImageBitmap(Util.getBitmapFromFile(filePath));

Screenshoot on hdpi & mdpi http://202.148.2.34/~lorenz/iview.jpg

A: 

Try adding a scale type to it

mImage.setScaleType(ScaleType.FIT_XY);

There are lot of scaling type available. Check which one suits you.

Rahul
Hi Rahul..thanx a lot, it works perfectly..:-)
Lorensius W. L. T