IScrollCaptureCallback.OnScrollCaptureImageRequest Method

Definition

An image capture has been requested from the scrolling content.

[Android.Runtime.Register("onScrollCaptureImageRequest", "(Landroid/view/ScrollCaptureSession;Landroid/os/CancellationSignal;Landroid/graphics/Rect;Ljava/util/function/Consumer;)V", "GetOnScrollCaptureImageRequest_Landroid_view_ScrollCaptureSession_Landroid_os_CancellationSignal_Landroid_graphics_Rect_Ljava_util_function_Consumer_Handler:Android.Views.IScrollCaptureCallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=31)]
public void OnScrollCaptureImageRequest (Android.Views.ScrollCaptureSession session, Android.OS.CancellationSignal signal, Android.Graphics.Rect captureArea, Java.Util.Functions.IConsumer onComplete);
[<Android.Runtime.Register("onScrollCaptureImageRequest", "(Landroid/view/ScrollCaptureSession;Landroid/os/CancellationSignal;Landroid/graphics/Rect;Ljava/util/function/Consumer;)V", "GetOnScrollCaptureImageRequest_Landroid_view_ScrollCaptureSession_Landroid_os_CancellationSignal_Landroid_graphics_Rect_Ljava_util_function_Consumer_Handler:Android.Views.IScrollCaptureCallbackInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=31)>]
abstract member OnScrollCaptureImageRequest : Android.Views.ScrollCaptureSession * Android.OS.CancellationSignal * Android.Graphics.Rect * Java.Util.Functions.IConsumer -> unit

Parameters

session
ScrollCaptureSession

the current session, resources provided by it are valid for use until the #onScrollCaptureEnd(Runnable) session ends

signal
CancellationSignal

signal to cancel the operation in progress

captureArea
Rect

the area to capture, a rectangle within scrollBounds

onComplete
IConsumer

a consumer for the captured area

Attributes

Remarks

An image capture has been requested from the scrolling content.

The requested rectangle describes an area inside the target view, relative to scrollBounds. The content may be offscreen, above or below the current visible portion of the target view. To handle the request, render the available portion of this rectangle to a buffer and return it via the Surface available from ScrollCaptureSession#getSurface().

Note: Implementations are only required to render the requested content, and may do so into off-screen buffers without scrolling if they are able.

The resulting available portion of the request must be computed as a portion of captureArea, and sent to signal the operation is complete, using Consumer#accept onComplete.accept. If the requested rectangle is partially or fully out of bounds the resulting portion should be returned. If no portion is available (outside of available content), then skip sending any buffer and report an empty Rect as result.

This request may be cancelled via the provided CancellationSignal. When this happens, any future call to Consumer#accept onComplete.accept will be ignored until the next request.

Java documentation for android.view.ScrollCaptureCallback.onScrollCaptureImageRequest(android.view.ScrollCaptureSession, android.os.CancellationSignal, android.graphics.Rect, java.util.function.Consumer<android.graphics.Rect>).

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