Image does not adjust automatically

In android, when we open a screenshot from the gallery. It blurs for 2 seconds and then automatically adjusts.

But when I use this screenshot image to set the image using the image path as :,

Image Path: /mnt/sdcard/ScreenCapture/SC20130219-124221.png

private void showImage(String imgPath) {
        // TODO Auto-generated method stub

        System.out.println("Image Path is:  "+imgPath);

        ImageView openImage=(ImageView)findViewById(R.id.img_fullScreen);
        ExifInterface exifMedia = null;
        try {
            exifMedia = new ExifInterface(imgPath);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        String exifOrint = exifMedia.getAttribute(ExifInterface.TAG_ORIENTATION);
        int exifOrientation = Integer.parseInt(exifOrint);
        System.out.println("Orientation Tag is:"+exifOrientation);
        BitmapFactory.Options mOptions=new BitmapFactory.Options();
        mOptions.inSampleSize=2;
        Bitmap imgBitmap = BitmapFactory.decodeFile(imgPath,mOptions);
        //Runtime.getRuntime().gc();

        imgBitmap = getResizedBitmapImage(imgBitmap, 200, 200, exifOrientation);
        openImage.setImageBitmap(imgBitmap);
    }

Another case: when getting a Bitmap from a URL:

URL url = new URL(urlTarget);
            BitmapFactory.Options mOptions = new BitmapFactory.Options();
            mOptions.inSampleSize=1;
            Bitmap bmp = BitmapFactory.decodeStream(url
                    .openConnection().getInputStream(),null,mOptions);

Then the image will not be automatically adjusted. He comes BLURRED. THAT'S MY PROBLEM.

ONLY IN CASE OF A SCREEN.

thank

+5
source share
3 answers

mOptions.inSampleSize=2; 1/2 . , , - .

Gallery, , , .

+1

Android Gallery ( , , ).
, , ImageView. , , ImageView, , .
, . , .
( API-)

0

mOptions.inSampleSize = 2 mOptions.inSampleSize =1 .

0

All Articles