我有一个图像视图
<ImageView
android:id="@+id/imgCaptured"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/captured_image" />
我从相机捕捉图像,将该图像转换为位图。
Bitmap thumbnail;
thumbnail = MediaStore.Images.Media.getBitmap(getActivity()
.getContentResolver(), imageUri);
当我在上面的图像视图中显示该位图之前获得该位图的分辨率时,例如
Log.i("ImageWidth = " + thumbnail.getWidth(), "ImageHeight = "
+ thumbnail.getHeight());
它让我回归ImageWidth = 2592 ImageHeight = 1936
在此之后,我在上面的 imageview 中显示了这个位图,imgCaptured.setImageBitmap(thumbnail);
然后我将 imageview 的大小设置为
Log.i("ImageView Width = " + imgCaptured.getWidth(),
"ImageView Height = " + imgCaptured.getHeight());
这让我回来了ImageView Width = 480 ImageView Height = 720
现在我的问题是
在我的图像视图中显示该位图后,如何获得该位图的大小。我知道这可以通过使用这个来完成
image.buildDrawingCache(); Bitmap bmap = image.getDrawingCache();
但这将创建一个大小等于 imageview 的新位图。
我也想知道,图像在图像视图中显示后是否会自动调整大小。如果是,那么有什么方法可以在不调整图像大小的情况下在 imageview 中显示图像。
编辑
实际上我已经捕获了 2592x1936 的图像。我在我的 imageView 中显示了这张图片,对这张图片做了一些其他的操作。现在我想以相同的 2592x1936 分辨率保存此图像。是否可以?
提前致谢。