Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
765 views
in Technique[技术] by (71.8m points)

bitmap - data.getExtras().get("data") result of low resolution image in android

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?

Code is like that;

    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");
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Mightier nailed it. Without including extras you only get a small sized image. From the Android documentation:

public static final String ACTION_IMAGE_CAPTURE Since: API Level 3

Standard Intent action that can be sent to have the camera application capture an image and return it.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...