Preface
This chapter describes android. media. ThumbnailUtils and its version is Android 3.0 r1! I look forward to your participation in Android API translation, contact me over140@gmail.com.
Statement
You are welcome to repost, but please keep the original source of the article :)
Blog Garden: http://www.cnblogs.com/
Android Chinese translation group: http://goo.gl/6vJQl
Body
I. Structure
Public class ThumbnailUtils extends Object
Java. lang. Object
Android. media. ThumbnailUtils
Ii. Overview
Generate regular thumbnails for the media. (Android123: this class is a new class added to Android2.2, which can help us retrieve thumbnails of video or image files in the system from mediaprovider)
3. Constants
Public static final intOPTIONS_RECYCLE_INPUT
Constants are used to indicate that they should be recycled.extractThumbnail(Bitmap, int, int, int)
Enter the source image (the first parameter) unless the output image is the input image.
Constant Value: 2 (0x00000002)
Iv. Public Methods
Public static BitmapCreateVideoThumbnail(String filePath, int kind)
Create a thumbnail of a video. If the video is damaged or the format is not supported, null may be returned.
Parameters
FilePath: Specifies the video file path.
Kind can be MINI_KIND or MICRO_KIND
Public static BitmapExtractThumbnail(Bitmap source, int width, int height, int options)
Create a bitmap with the required size and center scaling.
Parameters
Source
Width
Height: Target height
Options
Public static BitmapExtractThumbnail(Bitmap source, int width, int height)
Create a bitmap with the required size and center scaling.
Parameters
Source
Width
Height: Target height
5. Supplement
Article Link
ThumbnailUtils-Android2.2 new class (Android123)
[Recommended] source code of the Android thumbnail class (Android123)