我有一个ImageView
<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);
当我在以上ImageView中显示此位图之前,获取其分辨率的方法是:
Log.i("ImageWidth = " + thumbnail.getWidth(), "ImageHeight = "
+ thumbnail.getHeight());
返回结果是ImageWidth = 2592 ImageHeight = 1936
然后我用imgCaptured.setImageBitmap(thumbnail);
在我的上面的imageview中显示这个位图,然后我获取了我的imageview的大小。
Log.i("ImageView Width = " + imgCaptured.getWidth(),
"ImageView Height = " + imgCaptured.getHeight());
这让我知道了 ImageView
的宽度为480,高度为720。
现在我的问题是:
How can i get the size of that bitmap after displaying it in my imageview. I know this can be done by using this
image.buildDrawingCache(); Bitmap bmap = image.getDrawingCache();
but this will create a new bitmap of size equal to that of imageview.
I also want to know that, Does image resized automatically after displaying it in the imageview. if yes then is there any way to display the image in imageview without resizing the image.
编辑
我实际上拍摄了一张2592x1936的图像,并在我的imageView中显示了这张图像,对这张图像进行了一些其他操作。现在我想以同样的2592x1936分辨率保存这个图像。这可能吗?
提前致谢。