public class ThumbnailUtils
extends Object
java.lang.Object | |
↳ | android.media.ThumbnailUtils |
Thumbnail generation routines for media provider.
Constants |
|
---|---|
int |
OPTIONS_RECYCLE_INPUT Constant used to indicate we should recycle the input in |
Public constructors |
|
---|---|
ThumbnailUtils() |
Public methods |
|
---|---|
static Bitmap |
createVideoThumbnail(String filePath, int kind) Create a video thumbnail for a video. |
static Bitmap |
extractThumbnail(Bitmap source, int width, int height, int options) Creates a centered bitmap of the desired size. |
static Bitmap |
extractThumbnail(Bitmap source, int width, int height) Creates a centered bitmap of the desired size. |
Inherited methods |
|
---|---|
![]() java.lang.Object
|
int OPTIONS_RECYCLE_INPUT
Constant used to indicate we should recycle the input in extractThumbnail(Bitmap, int, int, int)
unless the output is the input.
Constant Value: 2 (0x00000002)
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.
Parameters | |
---|---|
filePath |
String : the path of video file |
kind |
int : could be MINI_KIND or MICRO_KIND |
Returns | |
---|---|
Bitmap |
Bitmap extractThumbnail (Bitmap source, int width, int height, int options)
Creates a centered bitmap of the desired size.
Parameters | |
---|---|
source |
Bitmap : original bitmap source |
width |
int : targeted width |
height |
int : targeted height |
options |
int : options used during thumbnail extraction |
Returns | |
---|---|
Bitmap |
Bitmap extractThumbnail (Bitmap source, int width, int height)
Creates a centered bitmap of the desired size.
Parameters | |
---|---|
source |
Bitmap : original bitmap source |
width |
int : targeted width |
height |
int : targeted height |
Returns | |
---|---|
Bitmap |