xtd - Reference Guide
0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
|
#include <screen.h>
Represents a display device or multiple display devices on a single system.
Inherits xtd::object.
Public Member Functions | |
int32_t | bits_per_pixel () const |
Gets the number of bits of memory, associated with one pixel of data. | |
const drawing::rectangle & | bounds () const |
Gets the bounds of the display. | |
const xtd::ustring & | device_name () const |
Gets the device name associated with a display. | |
bool | high_resolution () const |
Gets a value indicating whether a particular display is high resolution. | |
int32_t | pixels_per_inch () const |
Gets the number of pixels per inch of the display. | |
bool | primary () const |
Gets a value indicating whether a particular display is the primary device. | |
double | scale_factor () const |
Gets the scale factor of the display. | |
const drawing::rectangle & | working_area () const |
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 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. | |
template<typename object_t > | |
std::unique_ptr< object_t > | memberwise_clone () const |
Gets the type of the current instance. | |
virtual xtd::ustring | to_string () const noexcept |
Returns a std::string that represents the current object. | |
Static Public Member Functions | |
static std::vector< screen > | all_screens () |
Gets an array of all displays on the system. | |
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_t 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 (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 drawing::rectangle | get_bounds (intptr_t handle) |
Retrieves the bounds of the display that contains the largest portion of the specified handle. | |
static int32_t | 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 (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. | |
static drawing::rectangle | get_working_area (intptr_t 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 screen | primary_screen () |
Gets the primary display. | |
Static Public Member Functions inherited from xtd::object | |
static bool | equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are considered equal. | |
static bool | reference_equals (const object &object_a, const object &object_b) noexcept |
Determines whether the specified object instances are the same instance. | |
|
static |
Gets an array of all displays on the system.
|
inline |
Gets the number of bits of memory, associated with one pixel of data.
|
inline |
Gets the bounds of the display.
|
inline |
Gets the device name associated with a display.
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. |
|
static |
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 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 |
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 |
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 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. |
|
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. |
|
inline |
Gets a value indicating whether a particular display is high resolution.
|
inline |
Gets the number of pixels per inch of the display.
|
inline |
Gets a value indicating whether a particular display is the primary device.
|
inlinestatic |
Gets the primary display.
|
inline |
Gets the scale factor of the display.
|
inline |
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.