Compartilhar via


UiAutomation.TakeScreenshot Method

Definition

Overloads

TakeScreenshot()

Takes a screenshot.

TakeScreenshot(Window)

Used to capture a screenshot of a Window.

TakeScreenshot()

Takes a screenshot.

[Android.Runtime.Register("takeScreenshot", "()Landroid/graphics/Bitmap;", "")]
public Android.Graphics.Bitmap? TakeScreenshot ();
[<Android.Runtime.Register("takeScreenshot", "()Landroid/graphics/Bitmap;", "")>]
member this.TakeScreenshot : unit -> Android.Graphics.Bitmap

Returns

The screenshot bitmap on success, null otherwise.

Attributes

Remarks

Takes a screenshot.

Java documentation for android.app.UiAutomation.takeScreenshot().

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

TakeScreenshot(Window)

Used to capture a screenshot of a Window.

[Android.Runtime.Register("takeScreenshot", "(Landroid/view/Window;)Landroid/graphics/Bitmap;", "", ApiSince=34)]
public Android.Graphics.Bitmap? TakeScreenshot (Android.Views.Window window);
[<Android.Runtime.Register("takeScreenshot", "(Landroid/view/Window;)Landroid/graphics/Bitmap;", "", ApiSince=34)>]
member this.TakeScreenshot : Android.Views.Window -> Android.Graphics.Bitmap

Parameters

window
Window

Window to take a screenshot of

Returns

The screenshot bitmap on success, null otherwise.

Attributes

Remarks

Used to capture a screenshot of a Window. This can return null in the following cases: 1. Window content hasn't been layed out. 2. Window doesn't have a valid SurfaceControl 3. An error occurred in SurfaceFlinger when trying to take the screenshot.

Java documentation for android.app.UiAutomation.takeScreenshot(android.view.Window).

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