Dela via


HolographicDisplay.TryGetViewConfiguration Method

Definition

Attempts to retrieve the view configuration for this HolographicDisplay, which corresponds to the supplied HolographicViewConfigurationKind.

public:
 virtual HolographicViewConfiguration ^ TryGetViewConfiguration(HolographicViewConfigurationKind kind) = TryGetViewConfiguration;
HolographicViewConfiguration TryGetViewConfiguration(HolographicViewConfigurationKind const& kind);
public HolographicViewConfiguration TryGetViewConfiguration(HolographicViewConfigurationKind kind);
function tryGetViewConfiguration(kind)
Public Function TryGetViewConfiguration (kind As HolographicViewConfigurationKind) As HolographicViewConfiguration

Parameters

kind
HolographicViewConfigurationKind

A HolographicViewConfigurationKind indicating the kind of view configuration to be retrieved.

Returns

A HolographicViewConfiguration object of the indicated kind, or null if the HolographicDisplay does not support the indicated HolographicViewConfigurationKind.

Windows requirements

Device family
Windows 10, version 1903 (introduced in 10.0.18362.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v8.0)

Examples

Example 1: Retrieve the default HolographicViewConfiguration

The default HolographicViewConfiguration for the default HolographicDisplay is always available, and it is enabled by default. You can reliably retrieve this view configuration as shown below.

auto defaultDisplayViewConfiguration = HolographicDisplay::GetDefault().TryGetViewConfiguration(HolographicViewConfigurationKind::Display);

After completing the step shown above, the app can (for example) use the view configuration to tune parameters such as the back buffer resolution and format.

Example 2: Enable dedicated rendering for mixed reality capture

To enable dedicated rendering for mixed reality capture, retrieve the HolographicViewConfiguration for HolographicViewConfigurationKind::PhotoVideoCamera as shown below.

auto mrcViewConfiguration = HolographicDisplay::GetDefault().TryGetViewConfiguration(HolographicViewConfigurationKind::PhotoVideoCamera);
if (mrcViewConfiguration)
{
    mrcViewConfiguration.IsEnabled(true);
}

After the app has completed the above step, the platform will then provide an additional HolographicCamera to the app when the user takes a mixed reality capture photo or video. This HolographicCamera provides view matrices corresponding to the photo/video camera location, and it provides projection matrices using the photo/video camera field of view. Content rendered to its back buffer will be composited with the captured image to create the mixed reality capture photo or video. Render target size and format can be set independently from other HolographicCamera objects.

Applies to

See also