共用方式為


WebView.CapturePicture Method

Definition

Caution

deprecated

Gets a new picture that captures the current contents of this WebView.

[Android.Runtime.Register("capturePicture", "()Landroid/graphics/Picture;", "GetCapturePictureHandler")]
[System.Obsolete("deprecated")]
public virtual Android.Graphics.Picture? CapturePicture ();
[<Android.Runtime.Register("capturePicture", "()Landroid/graphics/Picture;", "GetCapturePictureHandler")>]
[<System.Obsolete("deprecated")>]
abstract member CapturePicture : unit -> Android.Graphics.Picture
override this.CapturePicture : unit -> Android.Graphics.Picture

Returns

a picture that captures the current contents of this WebView

Attributes

Remarks

Gets a new picture that captures the current contents of this WebView. The picture is of the entire document being displayed, and is not limited to the area currently displayed by this WebView. Also, the picture is a static copy and is unaffected by later changes to the content being displayed.

Note that due to internal changes, for API levels between android.os.Build.VERSION_CODES#HONEYCOMB and android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH inclusive, the picture does not include fixed position elements or scrollable divs.

Note that from android.os.Build.VERSION_CODES#JELLY_BEAN_MR1 the returned picture should only be drawn into bitmap-backed Canvas - using any other type of Canvas will involve additional conversion at a cost in memory and performance.

This member is deprecated. Use #onDraw to obtain a bitmap snapshot of the WebView, or #saveWebArchive to save the content to a file.

Java documentation for android.webkit.WebView.capturePicture().

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