difference between MICRO_KIND and MINI_KIND in mediastore in android?

别说谁变了你拦得住时间么 提交于 2019-12-09 05:29:53

问题


In my android docs i don't have meaning in micro_kind and mini_kind, what is the difference in this two?

When it comes to displaying the Image what the difference in the two?

FOLLOWUP QUESTION: what is the difference in MediaStore.Images and MediaStore.Video and still give the output of an image, the path contain video path, how come even i use mediastore.images.thumbnail.mini_kind its still displaying image also?

Bitmap bmp = ThumbnailUtils.createVideoThumbnail(videoPath,
                MediaStore.Images.Thumbnails.MINI_KIND);

Bitmap bmp = ThumbnailUtils.createVideoThumbnail(videoPath,
                MediaStore.Video.Thumbnails.MINI_KIND);

回答1:


The difference is in the size (dimensions) of the thumbnail.

  • MINI_KIND: 512 x 384
  • MICRO_KIND: 96 x 96

So when it comes to displaying, the difference you will observe will be the difference in dimensions. MICRO_KIND is smaller and square, while MINI_KIND is relatively bigger and rectangular.

MediaStore.Images.Thumbnails.MINI_KIND and MediaStore.Video.Thumbnails.MINI_KIND are both integers with value 1

So when you call the methods above, what you are basically doing is:

Bitmap bmp = ThumbnailUtils.createVideoThumbnail(videoPath,1);

This is the reason it always works.

Just keep in mind as a convention to use:

  • MediaStore.Images.Thumbnails.MINI_KIND for image thumbnails and,
  • MediaStore.Video.Thumbnails.MINI_KIND for video thumbnails,

so as to make the code consistent and readable.



来源:https://stackoverflow.com/questions/20208007/difference-between-micro-kind-and-mini-kind-in-mediastore-in-android

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