مشاركة عبر


CameraOcclusionState Class

Definition

Represents the occlusion state of a camera device.

public ref class CameraOcclusionState sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 851968)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class CameraOcclusionState final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 851968)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class CameraOcclusionState
Public NotInheritable Class CameraOcclusionState
Inheritance
Object Platform::Object IInspectable CameraOcclusionState
Attributes

Windows requirements

Device family
Windows 11 (introduced in 10.0.22000.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v14.0)

Remarks

Get an instance of this class by implementing a handler for the CameraOcclusionInfo.StateChanged event and accessing the State property of the CameraOcclusionStateChangedEventArgs.

You should only use the shutter state data represented by this class while the camera is actively streaming. Apps should respond in a logical manner when they detect that the shutter is closed. This should include an in-app message to open the shutter. Applications must not automatically take an action (e.g., turning the camera off) or block the user from doing an action (e.g., turning on the camera) based on the shutter state, as not every camera will reliably report the shutter state when not streaming. Applications must not treat the reported shutter state as an absolute privacy indicator – it is only a notification that the camera believes the shutter is closed.

Properties

IsOccluded

Gets a boolean value that indicates whether the camera device is occluded.

Methods

IsOcclusionKind(CameraOcclusionKind)

Gets a value than indicates whether the current occlusion state is of the specified kind.

Applies to

See also