【发布时间】:2017-10-15 03:25:54
【问题描述】:
我在图库中获取图像,但某些图像宽度不适合设备宽度,因此如何在我的ImageView 中将图像宽度设置为设备宽度,但原始图像高度的高度相同。
下面是我设置的图片代码
Uri selectedImageUri = data.getData();
if (null != selectedImageUri) {
// Get the path from the Uri
String path = getPathFromURI(selectedImageUri);
Log.i("", "Image Path : " + path);
// Set the image in ImageView
try {
bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), selectedImageUri);
} catch (IOException e) {
e.printStackTrace();
}
imgEdit.setImageURI(selectedImageUri);
}
【问题讨论】:
-
图像或图像视图??您想在 imageView 中显示宽度为设备宽度的图像>?
标签: android image image-processing