Android では、ギャラリーからスクリーンショットを開くと。2 秒間ぼやけてから、自動調整されます。
しかし、このスクリーンショット画像を使用して、画像パスを次のように使用して画像ビューに設定する場合:,
画像パス: /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);
}
別のケース: URL からビットマップを次のように取得している間:
URL url = new URL(urlTarget);
BitmapFactory.Options mOptions = new BitmapFactory.Options();
mOptions.inSampleSize=1;
Bitmap bmp = BitmapFactory.decodeStream(url
.openConnection().getInputStream(),null,mOptions);
その場合、画像自体は自動調整されません。ぼやけています。これは私の問題です。
スクリーンショットのみの場合です。
ありがとう