DisplayProperties class

Expand
1 out of 1 rated this helpful - Rate this topic

DisplayProperties class

[This documentation is preliminary and is subject to change.]

Applies to: Metro style apps only

Provides various properties that are related to the physical display. For most of these properties, the class provides events to allow clients to monitor for changes in the properties.

Syntax


var displayProperties = Windows.Graphics.Display.DisplayProperties;

Attributes

MarshalingBehaviorAttribute(Agile)
StaticAttribute(Windows.Graphics.Display.IDisplayPropertiesStatics, NTDDI_WIN8)
VersionAttribute(NTDDI_WIN8)

Members

The DisplayProperties class has these types of members:

Events

The DisplayProperties class has these events.

EventDescription
ColorProfileChanged Occurs when the physical display's color profile changes.
LogicalDpiChanged Occurs when the LogicalDpi property changes because the pixels per inch (PPI) of the display changes.
OrientationChanged Occurs when either the CurrentOrientation or NativeOrientation property changes because of a mode change or a monitor change.
StereoEnabledChanged Occurs when the StereoEnabled property changes because support for stereoscopic 3D changes.

 

Methods

The DisplayProperties class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
GetColorProfileAsync Asynchronously gets the default International Color Consortium (ICC) color profile that is associated with the physical display.

 

Properties

The DisplayProperties class has these properties.

PropertyAccess typeDescription

AutoRotationPreferences

Read/writeGets and sets the preferred orientation of the app.

CurrentOrientation

Read-onlyGets the current orientation of a rectangular monitor.

LogicalDpi

Read-onlyGets the pixels per logical inch of the current environment.

NativeOrientation

Read-onlyGets the native orientation of the display monitor, which is typically the orientation where the buttons on the device match the orientation of the monitor.

ResolutionScale

Read-onlyGets the scale factor of the immersive environment.

StereoEnabled

Read-onlyGets a value that indicates whether the device supports stereoscopic 3D.

 

Remarks

We recommend that apps use a single delegate to handle most of the events because in most cases the change to each display property requires that the application redraw itself. Also, many property changes result from a single mode change that affects the entire operating system. All events share the following delegate type.

    [version(NTDDI_WIN8), object, uuid(dbdd8b01-f1a1-46d1-9ee3-543bcc995980)]
    delegate HRESULT DisplayPropertiesEventHandler([in] IInspectable *sender);

Apps can then implement a separate handler and register that handler for each property change event.

Any property change event of DisplayProperties might trigger if your app is moved from one monitor to another monitor. ColorProfileChanged is only triggered when your app is moved to another monitor and that monitor has a different color profile. LogicalDpiChanged is triggered when either the LogicalDpi or ResolutionScale property changes because a user selected a different zoom level or changed the screen resolution. OrientationChanged is triggered if a user changes the screen orientation.

Requirements

Minimum supported client

Windows 8 Release Preview

Minimum supported server

Windows Server 2012

Namespace

Windows.Graphics.Display
Windows::Graphics::Display [C++]

Metadata

Windows.winmd

 

 

Build date: 5/22/2012

Did you find this helpful?
(1500 characters remaining)
Community Additions ADD