0

SD から imageview に画像を読み込んでいますが、画像がぼやけています。

画質を向上させるには...何か解決策はありますか..?

これがコードです...

Bitmap image = null;
                try {
                    Uri selectedImage = data.getData();
                    String[] filePathColumn = { MediaStore.Images.Media.DATA };
                    Cursor cursor = getContentResolver()
                            .query(selectedImage, filePathColumn, null,
                                    null, null);
                    cursor.moveToFirst();
                    int columnIndex = cursor
                            .getColumnIndex(filePathColumn[0]);
                    String filePath = cursor.getString(columnIndex);
                    cursor.close();
                    File file = new File(filePath);
                    image = decodeFile(file);

                } catch (java.lang.OutOfMemoryError e) {
                    e.printStackTrace();
                    Toast.makeText(getApplicationContext(),
                            "Image size is too large !", Toast.LENGTH_SHORT)
                            .show();
                } catch (Exception e) {
                    e.printStackTrace();
                    Toast.makeText(getApplicationContext(),
                            "Try with different image !",
                            Toast.LENGTH_SHORT).show();
                }
                mainImage = (ImageView) findViewById(R.id.img_mainImg);
                mainImage.setImageBitmap(image);
4

1 に答える 1