Organizational Research By

Surprising Reserch Topic

Question:Image is not auto adjusting


In android, when we open a screenshot from gallery. It comes blurred for 2 secs and then auto adjusts itself.

But when I am using this screenshot image to set on a imageview using image path as :,

Image Path is: /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: While getting the Bitmap from the URL as :

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 is not auto adjusted itself. It comes BLURRED. THIS IS MY PROBLEM.

IT IS IN THE CASE OF SCREENSHOT ONLY.

tHANKS
asked Sep 13, 2013 in ANDROID by rajesh
edited Sep 12, 2013
0 votes
21 views



Related Hot Questions



Government Jobs Opening


...