DisplayInfo

Wisej.Hybrid.Shared.Display.DisplayInfo

Namespace: Wisej.Hybrid.Shared.Display

Assembly: Wisej.Hybrid (3.5.0.0)

Represents information about the device's screen.

public class DisplayInfo

Constructors

DisplayInfo(width, height, density, orientation, rotation)

Initializes a new instance of the DisplayInfo class.

Name
Type
Description

width

The width of the display.

height

The height of the display.

density

The screen density.

orientation

The current orientation.

rotation

The rotation of the device.

DisplayInfo(width, height, density, orientation, rotation, rate)

Initializes a new instance of the DisplayInfo class.

Name
Type
Description

width

The width of the display.

height

The height of the display.

density

The screen density.

orientation

The current orientation.

rotation

The rotation of the device.

rate

The refresh rate of the display.

Properties

Density

Double: Gets a value representing the screen density.

The density is the scaling or a factor that can be used to convert between physical pixels and scaled pixels. For example, on high resolution displays, the physical number of pixels increases, but the scaled pixels remain the same. In a practical example for iOS, the Retina display will have a density of 2.0 or 3.0, but the units used to lay out a view does not change much. A view with a UI width of 100 may be 100 physical pixels (density = 1) on a non-Retina device, but be 200 physical pixels (density = 2) on a Retina device. On Windows, the density works similarly, and may often relate to the scale used in the display. On some monitors, the scale is set to 100% (density = 1), but on other high resolution monitors, the scale may be set to 200% (density = 2) or even 250% (density = 2.5).

Height

Double: Gets the height of the screen (in pixels) for the current Orientation.

Orientation

DisplayOrientation: Gets the orientation of the device's display.

RefreshRate

Single: Gets the refresh rate (in Hertz) of the device's display.

Rotation

DisplayRotation: Gets the orientation of the device's display.

Width

Double: Gets the width of the screen (in pixels) for the current Orientation.

Last updated