What is size of thumbnail returned by ACTION_IMAGE_CAPTURE intent

梦想与她 提交于 2019-12-13 16:06:58

问题


I'm using the standard camera intent to take a photo:

Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(takePictureIntent, actionCode);

And then in onActivityResult()

Bundle extras = intent.getExtras();
Bitmap imageBitmap = (Bitmap) extras.get("data");
mImageView.setImageBitmap(imageBitmap);

Bitmap is a thumbnail. That's great - I don't need full size images.

Before user can take a photo, I display a default thumbnail that they can click and that will open the camera. However, I don't know what to size the default thumbnail.

  1. Would the camera app return thumbnails of different size per device?
  2. Is there an Android standard?
  3. Will some devices return really small or really large thumbnails? In that case I need to specify the size before hand. How can I do that?

MediaStore.Images.Thumbnails.MICRO_KIND is 96x96. http://developer.android.com/reference/android/provider/MediaStore.Images.Thumbnails.html Is that the size being returned by default?


回答1:


Size of the thumbnail is determined by the camera capabilities. Camera.Parameters class defines getJpegThumbnailSize() method.



来源:https://stackoverflow.com/questions/15399121/what-is-size-of-thumbnail-returned-by-action-image-capture-intent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!