Delen via


CameraOcclusionInfo Class

Definition

Provides information about the occlusion state of a camera device.

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

Windows requirements

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

Remarks

Many devices provide mechanisms, such as a mechanical shutter, that allow the user to occlude the camera device for privacy. Other devices may occlude the camera in certain postures. This interface allows applications to receive notifications when the occlusion state of the camera changes so they can disable or modify their camera capture behavior when the camera is occluded.

Get an instance of this class by accessing the CameraOcclusionInfo property of the VideoDeviceController associated with the camera.

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., turn 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.

Methods

GetState()

Gets the current occlusion state of the camera device.

IsOcclusionKindSupported(CameraOcclusionKind)

Gets a boolean value indicating whether the specified occlusion kind is supported by the camera device.

Events

StateChanged

Raised when the occlusion state of the camera device changes.

Applies to

See also