Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Monitors and controls display-related information for an application view. The class provides events to allow clients to monitor for changes in the application view affecting which display(s) the view resides on, as well as changes in displays that can affect the application view.
public ref class DisplayInformation sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)] /// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] class DisplayInformation final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] public sealed class DisplayInformation
Public NotInheritable Class DisplayInformation
Windows 10 (introduced in 10.0.10240.0)
Windows.Foundation.UniversalApiContract (introduced in v1.0)
A DisplayInformation instance does not map to a specific display, but instead tracks display-related information for wherever the application view is placed. Calling GetForCurrentView will always return the single instance for the current thread's CoreApplicationView. An instance of DisplayInformation can only be used from the thread on which it was created.
To handle DisplayInformation events, use an event handler for the specific event. For example, for DisplayInformation.DpiChanged, use "TypedEventHandler<DisplayInformation, Object> DpiChanged."
Any property change event of DisplayInformation might trigger if your app is moved from one monitor to another monitor. ColorProfileChanged is triggered when the display’s color profile changes. DpiChanged is triggered when the LogicalDpi, ResolutionScale, and RawPixelsPerViewPixel properties change because a user selected a different zoom level or changed the screen resolution. OrientationChanged is triggered if a user changes the screen orientation.
|Windows version||SDK version||Value added|
Gets and sets the preferred orientation of the app.
Gets the current orientation of a rectangular monitor.
Diagonal size of the display in inches.
Gets the pixels per logical inch of the current environment.
Gets the native orientation of the display monitor, which is typically the orientation where the buttons on the device match the orientation of the monitor.
Gets the raw dots per inch (DPI) along the x axis of the display monitor.
Gets the raw dots per inch (DPI) along the y axis of the display monitor.
Gets a value representing the number of raw (physical) pixels for each view (layout) pixel.
Gets the scale factor of the immersive environment.
Returns the current height resolution of the logical monitor.
Returns the current width resolution of the logical monitor.
Gets a value that indicates whether the device supports stereoscopic 3D.
Retrieves the Advanced Color information.
Asynchronously gets the default International Color Consortium (ICC) color profile that is associated with the physical display.
Gets the DisplayInformation instance associated with the current thread's CoreApplicationView. This DisplayInformation instance is tied to the view and cannot be used from other threads.
Raised when the advanced color information is changed.
Occurs when the physical display's color profile changes.
Occurs when the display requires redrawing.
Occurs when the LogicalDpi property changes because the pixels per inch (PPI) of the display changes.
Occurs when the StereoEnabled property changes because support for stereoscopic 3D changes.
- Display orientation sample (Windows 10)
- Scaling according to DPI sample (Windows 10)
- Camera preview frame sample (Windows 10)
- Basic camera app sample (Windows 10)
- Video stabilization sample (Windows 10)
- Camera face detection sample (Windows 10)
- Manual camera controls sample (Windows 10)
- High dynamic range sample (Windows 10)
- Camera Advanced Capture sample