HolographicDisplay.TryGetViewConfiguration(HolographicViewConfigurationKind) HolographicDisplay.TryGetViewConfiguration(HolographicViewConfigurationKind) HolographicDisplay.TryGetViewConfiguration(HolographicViewConfigurationKind) HolographicDisplay.TryGetViewConfiguration(HolographicViewConfigurationKind) HolographicDisplay.TryGetViewConfiguration(HolographicViewConfigurationKind) Method

Definition

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

public : HolographicViewConfiguration TryGetViewConfiguration(HolographicViewConfigurationKind kind)
HolographicViewConfiguration TryGetViewConfiguration(HolographicViewConfigurationKind kind) const;
public HolographicViewConfiguration TryGetViewConfiguration(HolographicViewConfigurationKind kind)
Public Function TryGetViewConfiguration(kind As HolographicViewConfigurationKind) As HolographicViewConfiguration
var holographicViewConfiguration = holographicDisplay.tryGetViewConfiguration(kind);

Parameters

Returns

Additional features and requirements

Device family
Windows 10, version 1903 (introduced v10.0.18362.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v8)

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.

See also