ContentResolver.LoadThumbnail(Uri, Size, CancellationSignal) Method

Definition

Convenience method that efficiently loads a visual thumbnail for the given Uri.

[Android.Runtime.Register("loadThumbnail", "(Landroid/net/Uri;Landroid/util/Size;Landroid/os/CancellationSignal;)Landroid/graphics/Bitmap;", "GetLoadThumbnail_Landroid_net_Uri_Landroid_util_Size_Landroid_os_CancellationSignal_Handler", ApiSince=29)]
public virtual Android.Graphics.Bitmap LoadThumbnail (Android.Net.Uri uri, Android.Util.Size size, Android.OS.CancellationSignal? signal);
[<Android.Runtime.Register("loadThumbnail", "(Landroid/net/Uri;Landroid/util/Size;Landroid/os/CancellationSignal;)Landroid/graphics/Bitmap;", "GetLoadThumbnail_Landroid_net_Uri_Landroid_util_Size_Landroid_os_CancellationSignal_Handler", ApiSince=29)>]
abstract member LoadThumbnail : Android.Net.Uri * Android.Util.Size * Android.OS.CancellationSignal -> Android.Graphics.Bitmap
override this.LoadThumbnail : Android.Net.Uri * Android.Util.Size * Android.OS.CancellationSignal -> Android.Graphics.Bitmap

Parameters

uri
Uri

The item that should be visualized as a thumbnail.

size
Size

The target area on the screen where this thumbnail will be shown. This is passed to the provider as #EXTRA_SIZE to help it avoid downloading or generating heavy resources.

signal
CancellationSignal

A signal to cancel the operation in progress.

Returns

Valid Bitmap which is a visual thumbnail.

Attributes

Remarks

Convenience method that efficiently loads a visual thumbnail for the given Uri. Internally calls ContentProvider#openTypedAssetFile on the remote provider, but also defensively resizes any returned content to match the requested target size.

Java documentation for android.content.ContentResolver.loadThumbnail(android.net.Uri, 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