Most visited

Recently visited

Added in API level 8

ThumbnailUtils

public class ThumbnailUtils
extends Object

java.lang.Object
   ↳ android.media.ThumbnailUtils


媒体提供商的缩略图生成例程。

Summary

Constants

int OPTIONS_RECYCLE_INPUT

常量用于表示我们应该回收 extractThumbnail(Bitmap, int, int, int)的输入,除非输出是输入。

Public constructors

ThumbnailUtils()

Public methods

static Bitmap createVideoThumbnail(String filePath, int kind)

为视频创建视频缩略图。

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

创建所需大小的居中位图。

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

创建所需大小的居中位图。

Inherited methods

From class java.lang.Object

Constants

OPTIONS_RECYCLE_INPUT

Added in API level 8
int OPTIONS_RECYCLE_INPUT

常数用于表示我们应该回收 extractThumbnail(Bitmap, int, int, int)的输入,除非输出是输入。

常量值: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)

为视频创建视频缩略图。 如果视频损坏或格式不被支持,可能会返回null。

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)

创建所需大小的居中位图。

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)

创建所需大小的居中位图。

Parameters
source Bitmap: original bitmap source
width int: targeted width
height int: targeted height
Returns
Bitmap

Hooray!