【发布时间】:2014-09-12 08:17:12
【问题描述】:
我允许用户拍照,我将这张照片设置在 imageview 中。
这是我的图像视图代码:
<ImageView
android:id="@+id/photo1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_marginBottom="2dp" />
还有我将照片放入此图像视图的代码:
imgPhoto1.setImageBitmap(btmap);
我的问题是,照片显示模糊.....
如何才能拥有“正确”的质量?
我试过用这个:
getWindow().setFormat(PixelFormat.RGBA_8888);
但它没有任何改变。
谢谢,
编辑:请,如果可能的话,我正在寻找不使用库的解决方案,它仅适用于两个 imageview..
编辑 2:好的,没有库似乎是不可能的,因为我的图像占用了屏幕上的所有可用空间。
【问题讨论】:
-
你检查过这个链接了吗:--stackoverflow.com/questions/25071007/…。可能重复。
-
从
ImageView中删除layout_weight属性 -
它与库无关,但是如果图像是 100x100 像素并且您尝试适合 1000x1200 视图,它将被拉伸和“模糊”。你必须自己找到一种更好的布局方式。
-
@Nicks 在您的情况下,您似乎使用了图像的 URI。就我而言,我直接拥有位图。我暂时不知道如何正确使用这个库:/
-
@deveLost:你从
drawable文件夹访问该图像