Skip to content

Most visited

Recently visited

navigation

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
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.