1
このコードを使用して、画像ビュー(風景モード)でSdcardから画像を表示しています。しかし、イメージはその品質を失い、ぼやけてしまいます。ImageView AndroidでSdcardから表示すると画像がぼやける
File imgFile = new File(imageFile.getAbsolutePath()); // path of your file
FileInputStream fis = null;
try {
fis = new FileInputStream(imgFile);
} catch (FileNotFoundException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 8;
options.inPurgeable = true;
options.inScaled = true;
Bitmap bm = BitmapFactory.decodeStream(fis, null,options);
profileIV.setImageBitmap(bm);
ImageViewのxmlファイル:
<ImageView
android:id="@+id/image11"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
>
コーディングハッピーオリエンテーション部分をスキップすることができ、これを試してみてくださいピカソについて知っているのであれば、ビットマップを作成する必要はありませんPicassoを使用して画像を表示するには、Picasso.with(mContext).load(Uri.fromFile(new File(imagePath))))。 –
私はこれを試してみましょう –
@mohit希望ピカソは作成されませんより大きいイメージのためのHeapsizeの問題 –