Class Screen
Represents a single display screen.
public class Screen : IEquatable<Screen>
- Inheritance
-
Screen
- Implements
- Derived
- Inherited Members
Constructors
Screen(double, PixelRect, PixelRect, bool)
Initializes a new instance of the Screen class.
[Unstable("This API may be removed in Avalonia 12. If you depend on this API, please open an issue with details of your use-case.")]
public Screen(double scaling, PixelRect bounds, PixelRect workingArea, bool isPrimary)
Parameters
scaling
doubleThe scaling factor applied to the screen by the operating system.
bounds
PixelRectThe overall pixel-size of the screen.
workingArea
PixelRectThe actual working-area pixel-size of the screen.
isPrimary
boolWhether the screen is the primary one.
Properties
Bounds
Gets the overall pixel-size and position of the screen.
public PixelRect Bounds { get; protected set; }
Property Value
Remarks
This generally is the raw pixel counts in both the X and Y direction.
CurrentOrientation
Gets the current orientation of a screen.
public ScreenOrientation CurrentOrientation { get; protected set; }
Property Value
DisplayName
Gets the device name associated with a display.
public string? DisplayName { get; protected set; }
Property Value
IsPrimary
Gets a value indicating whether the screen is the primary one.
public bool IsPrimary { get; protected set; }
Property Value
Scaling
Gets the scaling factor applied to the screen by the operating system.
public double Scaling { get; protected set; }
Property Value
Remarks
Multiply this value by 100 to get a percentage. Both X and Y scaling factors are assumed uniform.
WorkingArea
Gets the actual working-area pixel-size of the screen.
public PixelRect WorkingArea { get; protected set; }
Property Value
Remarks
This area may be smaller than Bounds to account for notches and other block-out areas such as taskbars etc.
Methods
Equals(Screen?)
public virtual bool Equals(Screen? other)
Parameters
other
Screen
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
TryGetPlatformHandle()
Tries to get the platform handle for the Screen.
public virtual IPlatformHandle? TryGetPlatformHandle()
Returns
- IPlatformHandle
An IPlatformHandle describing the screen handle, or null if the handle could not be retrieved.
Operators
operator ==(Screen?, Screen?)
public static bool operator ==(Screen? left, Screen? right)
Parameters
Returns
operator !=(Screen?, Screen?)
public static bool operator !=(Screen? left, Screen? right)