Partager via


MediaProjection.CreateVirtualDisplay Method

Definition

Creates a VirtualDisplay to capture the contents of the screen.

[Android.Runtime.Register("createVirtualDisplay", "(Ljava/lang/String;IIIILandroid/view/Surface;Landroid/hardware/display/VirtualDisplay$Callback;Landroid/os/Handler;)Landroid/hardware/display/VirtualDisplay;", "")]
public Android.Hardware.Display.VirtualDisplay? CreateVirtualDisplay (string name, int width, int height, int dpi, Android.Views.DisplayFlags flags, Android.Views.Surface? surface, Android.Hardware.Display.VirtualDisplay.Callback? callback, Android.OS.Handler? handler);
[<Android.Runtime.Register("createVirtualDisplay", "(Ljava/lang/String;IIIILandroid/view/Surface;Landroid/hardware/display/VirtualDisplay$Callback;Landroid/os/Handler;)Landroid/hardware/display/VirtualDisplay;", "")>]
member this.CreateVirtualDisplay : string * int * int * int * Android.Views.DisplayFlags * Android.Views.Surface * Android.Hardware.Display.VirtualDisplay.Callback * Android.OS.Handler -> Android.Hardware.Display.VirtualDisplay

Parameters

name
String

The name of the virtual display, must be non-empty.

width
Int32

The width of the virtual display in pixels. Must be greater than 0.

height
Int32

The height of the virtual display in pixels. Must be greater than 0.

dpi
Int32

The density of the virtual display in dpi. Must be greater than 0.

flags
DisplayFlags

A combination of virtual display flags. See DisplayManager for the full list of flags.

surface
Surface

The surface to which the content of the virtual display should be rendered, or null if there is none initially.

callback
VirtualDisplay.Callback

Callback to call when the virtual display's state changes, or null if none.

handler
Handler

The Handler on which the callback should be invoked, or null if the callback should be invoked on the calling thread's main Looper.

Returns

Attributes

Remarks

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

See also