다음을 통해 공유


ThumbnailUtils.CreateVideoThumbnail Method

Definition

Overloads

CreateVideoThumbnail(String, ThumbnailKind)

Create a thumbnail for given video file.

CreateVideoThumbnail(File, Size, CancellationSignal)

Create a thumbnail for given video file.

CreateVideoThumbnail(String, ThumbnailKind)

Create a thumbnail for given video file.

[Android.Runtime.Register("createVideoThumbnail", "(Ljava/lang/String;I)Landroid/graphics/Bitmap;", "")]
public static Android.Graphics.Bitmap? CreateVideoThumbnail (string filePath, Android.Provider.ThumbnailKind kind);
[<Android.Runtime.Register("createVideoThumbnail", "(Ljava/lang/String;I)Landroid/graphics/Bitmap;", "")>]
static member CreateVideoThumbnail : string * Android.Provider.ThumbnailKind -> Android.Graphics.Bitmap

Parameters

filePath
String

The video file.

kind
ThumbnailKind

The desired thumbnail kind, such as android.provider.MediaStore.Images.Thumbnails#MINI_KIND.

Returns

Attributes

Remarks

Create a thumbnail for given video file.

This member is deprecated. Callers should migrate to using #createVideoThumbnail(File, Size, CancellationSignal), as it offers more control over resizing and cancellation.

Java documentation for android.media.ThumbnailUtils.createVideoThumbnail(java.lang.String, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

CreateVideoThumbnail(File, Size, CancellationSignal)

Create a thumbnail for given video file.

[Android.Runtime.Register("createVideoThumbnail", "(Ljava/io/File;Landroid/util/Size;Landroid/os/CancellationSignal;)Landroid/graphics/Bitmap;", "", ApiSince=29)]
public static Android.Graphics.Bitmap CreateVideoThumbnail (Java.IO.File file, Android.Util.Size size, Android.OS.CancellationSignal? signal);
[<Android.Runtime.Register("createVideoThumbnail", "(Ljava/io/File;Landroid/util/Size;Landroid/os/CancellationSignal;)Landroid/graphics/Bitmap;", "", ApiSince=29)>]
static member CreateVideoThumbnail : Java.IO.File * Android.Util.Size * Android.OS.CancellationSignal -> Android.Graphics.Bitmap

Parameters

file
File

The video file.

size
Size

The desired thumbnail size.

Returns

Attributes

Remarks

Create a thumbnail for given video file.

This method should only be used for files that you have direct access to; if you'd like to work with media hosted outside your app, consider using ContentResolver#loadThumbnail(Uri, Size, CancellationSignal) which enables remote providers to efficiently cache and invalidate thumbnails.

Java documentation for android.media.ThumbnailUtils.createVideoThumbnail(java.io.File, android.util.Size, android.os.CancellationSignal).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to