Most visited

Recently visited

Added in API level 8

ThumbnailUtils

public class ThumbnailUtils
extends Object

java.lang.Object
   ↳ android.media.ThumbnailUtils


Thumbnail generation routines for media provider.

Summary

Constants

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.

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

From class java.lang.Object

Constants

OPTIONS_RECYCLE_INPUT

Added in API level 8
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)

Public constructors

ThumbnailUtils

Added in API level 8
ThumbnailUtils ()

Public methods

createVideoThumbnail

Added in API level 8
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

extractThumbnail

Added in API level 8
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

extractThumbnail

Added in API level 8
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

Hooray!