1. public static Bitmap createVideoThumbnail (String filePath, int kind)
Create a video thumbnail for a video. May return null if the video is corrupt or the format is not supported.
译:返回视频缩略图,如果视频损坏或格式不被支持那么都将返回为空
ParametersfilePath the path of video file(视频文件路径)
kind could be MINI_KIND or MICRO_KIND
(缩略图类型 MINI_KIND: 512 x 384 thumbnail , MICRO_KIND: 96 x 96 thumbnail)
2. public static Bitmap extractThumbnail (Bitmap source, int width, int height, int options)
Creates a centered bitmap of the desired size.
译:创建一个指定大小居中的缩略图,如果options定义为OPTIONS_RECYCLE_INPUT,则回收资源
source original bitmap source(原始Bitmap源文件)
width targeted width(指定宽度)
height targeted height(指定高度)
options options used during thumbnail extraction(输出选项)
3. public static Bitmap extractThumbnail (Bitmap source, int width, int height)
Creates a centered bitmap of the desired size.
译:创建一个指定大小居中的缩略图
source original bitmap source(原始Bitmap源文件)
width targeted width(指定宽度)
height targeted height(指定高度)
ThumbnailUtils类是API Level从8或更高才开始支持的,不向下兼容