Skip to main content

DisplayInfo

Namespace: Wisej.Hybrid

Assembly: Wisej.Hybrid (4.1.0.0)

Represents information about the device's screen.

public class DisplayInfo

Constructors​

Instance member DisplayInfo(width, height, density, orientation, rotation)​

Initializes a new instance of the DisplayInfo class.

NameTypeDescription
widthDoubleThe width of the display.
heightDoubleThe height of the display.
densityDoubleThe screen density.
orientationDisplayOrientationThe current orientation.
rotationDisplayRotationThe rotation of the device.

Instance member DisplayInfo(width, height, density, orientation, rotation, rate)​

Initializes a new instance of the DisplayInfo class.

NameTypeDescription
widthDoubleThe width of the display.
heightDoubleThe height of the display.
densityDoubleThe screen density.
orientationDisplayOrientationThe current orientation.
rotationDisplayRotationThe rotation of the device.
rateSingleThe refresh rate of the display.

Properties​

Instance member 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).

Instance member Height​

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

Instance member Orientation​

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

Instance member RefreshRate​

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

Instance member Rotation​

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

Instance member Width​

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