Skip to main content

DeviceScreen

Namespace: Wisej.Hybrid

Assembly: Wisej.Hybrid

Access screenshot and recording operations through Device.Screen. This page compares the published 4.1.4 XML baseline with the 4.1.6 build artifact XML from run 38824178522 (private maintainer access). The artifact is build evidence; public 4.1.6 availability has not been independently rechecked. A method in the contract does not establish complete native support; check Platform Capabilities.

Constructors​

DeviceScreen()​

Use the Device.Screen singleton. The current source constructor is internal; application code should not instantiate this module.

Properties​

IsCaptureSupported​

bool: whether screen capture is supported on the connected device.

Methods​

CapturePhoto()​

Returns Image. The 4.1.4 XML notes a Windows WebView2 limitation; see WebView2 issue 2799. The 4.1.6 artifact XML instead describes Windows capture of the application window, including WebView content. The caller owns the returned image and must dispose it when replaced or when its view closes.

CapturePhotoAsync()​

Returns Task<Image>. The same image ownership rule applies.

StartRecording(microphone)​

Starts screen recording. microphone is a Boolean parameter indicating whether audio is requested. Returns whether recording started. Platform implementation and permission checks are required.

StartRecordingAsync(microphone)​

Returns Task<bool> in both compared versions. A false result can indicate declined system consent; handle native failures as well.

StopRecording()​

Requests that screen recording stop. The published 4.1.4 XML does not define a result-returning StopRecordingAsync method.

Events​

Recording​

EventHandler<MemoryStream>: receives the recording stream. Subscribe while the owning view needs the result and unsubscribe on disposal.

Recording additions in the 4.1.6 artifact​

The following members are absent from the 4.1.4 XML and present in the inspected 4.1.6 artifact XML. Signatures were compared with core source revision f495f5012da8059328b645c08cffed2644fd887d.

MemberContract
IsRecordingSupportedAsync()Task<bool>; queries native recording availability
StopRecordingAsync()Task<byte[]>; returns the completed MP4 bytes
RecordingFailedEventHandler<DeviceException>; reports unexpected stops or background stop failures

StopRecordingAsync() returns the completed result directly. The existing Recording event serves StopRecording() and supported system-initiated stops; its recipient owns the supplied MemoryStream. Unsubscribe both recording events when the owning view closes.

The compared source implements Android MediaProjection, Apple ReplayKit and Windows Graphics Capture. Windows microphone recording is unsupported. Check availability and permissions at runtime. Completed exports are limited to 32 MiB; Android stops at its configured limit, while Windows and Apple reject oversized exports. Apple system-initiated stops report a failure instead of returning preview bytes. These are source constraints, not completed device validation.

Check Release Notes, Platform Capabilities and the Showcase example. Verify the installed Wisej-facing and native package pair before using these additions.