data.getExtras().get("data") android中低分辨率图像的结果 [英] data.getExtras().get("data") result of low resolution image in android
问题描述
在我的应用程序中,我从相机拍了一张照片,然后我得到那张照片,对同一张照片进行一些图像处理操作,但是当我用 data.getExtras().get("data") 得到这张照片时,图片随附低分辨率不是真正的分辨率.问题的原因是什么?
In my app I take a picture from camera and then I get that picture to do some image processing operations on same picture but when I get this picture with data.getExtras().get("data") , picture come with low resolution not real taken resolution. What can be reason of the problem?
代码就是这样;
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent , CAMERA_PIC_REQUEST);
}
protected void onActivityResult(int requestCode , int resultCode , Intent data )
{
if( requestCode != 0)
{
ImageView image = (ImageView)findViewById(R.id.imageView1);
thumbnail = (Bitmap)data.getExtras().get("data");
推荐答案
Mightier 搞定了.如果不包括额外内容,您只会得到一个小尺寸的图像.来自 Android 文档:
Mightier nailed it. Without including extras you only get a small sized image. From the Android documentation:
public static final String ACTION_IMAGE_CAPTURE从:API 级别 3
public static final String ACTION_IMAGE_CAPTURE Since: API Level 3
可以发送标准 Intent 操作以使相机应用程序捕获图像并将其返回.
Standard Intent action that can be sent to have the camera application capture an image and return it.
调用者可能会传递一个额外的 EXTRA_OUTPUT 来控制这个图像的写入位置.如果 EXTRA_OUTPUT 不存在,则在额外字段中将小尺寸图像作为位图对象返回.这对于只需要小图像的应用程序很有用.如果存在 EXTRA_OUTPUT,则全尺寸图像将写入 EXTRA_OUTPUT 的 Uri 值.
The caller may pass an extra EXTRA_OUTPUT to control where this image will be written. If the EXTRA_OUTPUT is not present, then a small sized image is returned as a Bitmap object in the extra field. This is useful for applications that only need a small image. If the EXTRA_OUTPUT is present, then the full-sized image will be written to the Uri value of EXTRA_OUTPUT.
这篇关于data.getExtras().get("data") android中低分辨率图像的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!