Represents a display device or multiple display devices on a single system.
Public Properties | |
int32 | bits_per_pixel () const noexcept |
Gets the number of bits of memory, associated with one pixel of data. | |
const drawing::rectangle & | bounds () const noexcept |
Gets the bounds of the display. | |
const xtd::string & | device_name () const |
Gets the device name associated with a display. | |
bool | high_resolution () const noexcept |
Gets a value indicating whether a particular display is high resolution. | |
int32 | pixels_per_inch () const noexcept |
Gets the number of pixels per inch of the display. | |
bool | primary () const noexcept |
Gets a value indicating whether a particular display is the primary device. | |
double | scale_factor () const noexcept |
Gets the scale factor of the display. | |
const drawing::rectangle & | working_area () const noexcept |
Gets the working area of the display. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. | |
Public Static Properties | |
static std::vector< screen > | all_screens () |
Gets an array of all displays on the system. | |
static screen | primary_screen () |
Gets the primary display. | |
Public Static Methods | |
static drawing::graphics | create_graphics () |
Creates the xtd::drawing::graphics for the screen. | |
static screen | from_control (const control &control) |
Retrieves a screen for the display that contains the largest portion of the specified control. | |
static screen | from_handle (intptr handle) |
Retrieves a screen for the display that contains the largest portion of the object referred to by the specified handle. | |
static screen | from_point (const drawing::point &point) |
Retrieves a screen for the display that contains the specified point. | |
static screen | from_rectangle (const drawing::rectangle &rect) |
Retrieves a screen for the display that contains the largest portion of the rectangle. | |
static drawing::rectangle | get_bounds (const control &control) |
Retrieves the bounds of the display that contains the largest portion of the specified control. | |
static drawing::rectangle | get_bounds (intptr handle) |
Retrieves the bounds of the display that contains the largest portion of the specified handle. | |
static drawing::rectangle | get_bounds (const drawing::point &point) |
Retrieves the bounds of the display that contains the specified point. | |
static drawing::rectangle | get_bounds (const drawing::rectangle &rect) |
Retrieves the bounds of the display that contains the largest portion of the specified rectangle. | |
static int32 | get_standard_pixels_per_inch () |
Gets the the standard number of pixels per inch of the display. | |
static drawing::rectangle | get_working_area (const control &control) |
Retrieves the working area for the display that contains the largest region of the specified control. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. | |
static drawing::rectangle | get_working_area (intptr handle) |
Retrieves the working area for the display that contains the largest region of the specified handle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. | |
static drawing::rectangle | get_working_area (const drawing::point &point) |
Retrieves the working area closest to the specified point. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. | |
static drawing::rectangle | get_working_area (const drawing::rectangle &rect) |
Retrieves the working area for the display that contains the largest portion of the specified rectangle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. | |
Additional Inherited Members | |
Public Member Functions inherited from xtd::object | |
object ()=default | |
Create a new instance of the ultimate base class object. | |
virtual bool | equals (const object &obj) const noexcept |
Determines whether the specified object is equal to the current object. | |
virtual size_t | get_hash_code () const noexcept |
Serves as a hash function for a particular type. | |
virtual type_object | get_type () const noexcept |
Gets the type of the current instance. | |
template<typename object_t > | |
xtd::uptr< object_t > | memberwise_clone () const |
Creates a shallow copy of the current object. | |
virtual xtd::string | to_string () const noexcept |
Returns a xtd::string that represents the current object. | |
Static Public Member Functions inherited from xtd::object | |
template<typename object_a_t , typename object_b_t > | |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
template<typename object_a_t , typename object_b_t > | |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
|
noexcept |
Gets the number of bits of memory, associated with one pixel of data.
|
noexcept |
Gets the bounds of the display.
const xtd::string & xtd::forms::screen::device_name | ( | ) | const |
Gets the device name associated with a display.
|
noexcept |
Gets a value indicating whether a particular display is high resolution.
|
noexcept |
Gets the number of pixels per inch of the display.
|
noexcept |
Gets a value indicating whether a particular display is the primary device.
|
noexcept |
Gets the scale factor of the display.
|
noexcept |
Gets the working area of the display. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.
|
static |
Gets an array of all displays on the system.
|
static |
Gets the primary display.
|
static |
Creates the xtd::drawing::graphics for the screen.
Retrieves a screen for the display that contains the largest portion of the specified control.
control | A xtd::forms::control for which to retrieve a Screen. |
Retrieves a screen for the display that contains the largest portion of the object referred to by the specified handle.
handle | The window handle for which to retrieve the screen. |
|
static |
Retrieves a screen for the display that contains the specified point.
point | A xtd::drawing::point that specifies the location for which to retrieve a screen. |
|
static |
Retrieves a screen for the display that contains the largest portion of the rectangle.
A | xtd::drawing::rectangle that specifies the area for which to retrieve the display. |
|
static |
Retrieves the bounds of the display that contains the largest portion of the specified control.
control | The control for which to retrieve the display bounds. |
|
static |
Retrieves the bounds of the display that contains the largest portion of the specified handle.
handle | The window handle for which to retrieve the display bounds. |
|
static |
Retrieves the bounds of the display that contains the specified point.
point | A xtd::drawing::point that specifies the coordinates for which to retrieve the display bounds. |
|
static |
Retrieves the bounds of the display that contains the largest portion of the specified rectangle.
rect | A xtd::drawing::rectangle that specifies the area for which to retrieve the display bounds. |
|
static |
Gets the the standard number of pixels per inch of the display.
Values and conversion | Windows | macOS | linux |
---|---|---|---|
Pixels per inch (PPI) | 96 | 72 | 96 |
Pixels per centimeters (pixel/cm) | 38 | 28 | 38 |
Pitch (µm) | 265 | 353 | 265 |
|
static |
Retrieves the working area for the display that contains the largest region of the specified control. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.
control | The control for which to retrieve the working area. |
|
static |
Retrieves the working area for the display that contains the largest region of the specified handle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.
handle | The window handle for which to retrieve the working area. |
|
static |
Retrieves the working area closest to the specified point. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.
point | A xtd::drawing::point that specifies the coordinates for which to retrieve the working area. |
|
static |
Retrieves the working area for the display that contains the largest portion of the specified rectangle. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.
rect | The xtd::drawing::rectangle that specifies the area for which to retrieve the working area. |