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!