Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

ThumbnailUtils

extends Object
java.lang.Object
   ↳ android.media.ThumbnailUtils

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int OPTIONS_RECYCLE_INPUT

Added in API level 8

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

public ThumbnailUtils ()

Added in API level 8

Public Methods

public static Bitmap createVideoThumbnail ( String filePath, int kind)

Added in API level 8

Create a video thumbnail for a video. May return null if the video is corrupt or the format is not supported.

Parameters
filePath the path of video file
kind could be MINI_KIND or MICRO_KIND

public static Bitmap extractThumbnail ( Bitmap source, int width, int height, int options)

Added in API level 8

Creates a centered bitmap of the desired size.

Parameters
source original bitmap source
width targeted width
height targeted height
options options used during thumbnail extraction

public static Bitmap extractThumbnail ( Bitmap source, int width, int height)

Added in API level 8

Creates a centered bitmap of the desired size.

Parameters
source original bitmap source
width targeted width
height targeted height