Compartilhar via


ThumbnailUtils.CreateAudioThumbnail Method

Definition

Overloads

CreateAudioThumbnail(String, ThumbnailKind)

Create a thumbnail for given audio file.

CreateAudioThumbnail(File, Size, CancellationSignal)

Create a thumbnail for given audio file.

CreateAudioThumbnail(String, ThumbnailKind)

Create a thumbnail for given audio file.

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

Parameters

filePath
String

The audio file.

kind
ThumbnailKind

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

Returns

Attributes

Remarks

Create a thumbnail for given audio file.

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

Java documentation for android.media.ThumbnailUtils.createAudioThumbnail(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

CreateAudioThumbnail(File, Size, CancellationSignal)

Create a thumbnail for given audio file.

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

Parameters

file
File

The audio file.

size
Size

The desired thumbnail size.

Returns

Attributes

Remarks

Create a thumbnail for given audio 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.createAudioThumbnail(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