xtd 0.2.0
Loading...
Searching...
No Matches
screen.h
Go to the documentation of this file.
1
4#pragma once
5#include "control.h"
6#include <xtd/drawing/rectangle>
7#include <xtd/object>
8#include <cstdint>
9#include <vector>
10
12namespace xtd {
14 namespace forms {
30 class forms_export_ screen : public object {
31 public:
33 screen(const screen&) = default;
34 screen& operator =(const screen&) = default;
36
38
43 int32 bits_per_pixel() const noexcept;
44
47 const drawing::rectangle& bounds() const noexcept;
48
52 const xtd::ustring& device_name() const;
53
56 bool high_resolution() const noexcept;
57
61 int32 pixels_per_inch() const noexcept;
62
65 bool primary() const noexcept;
66
72 double scale_factor() const noexcept;
73
78 const drawing::rectangle& working_area() const noexcept;
80
82
86 static std::vector<screen> all_screens();
87
91 static screen primary_screen();
93
95
99 static drawing::graphics create_graphics();
100
104 static screen from_control(const control& control);
105
109 static screen from_handle(intptr handle);
110
114 static screen from_point(const drawing::point& point);
115
119 static screen from_rectangle(const drawing::rectangle& rect);
120
124 static drawing::rectangle get_bounds(const control& control);
125
129 static drawing::rectangle get_bounds(intptr handle);
130
134 static drawing::rectangle get_bounds(const drawing::point& point);
135
139 static drawing::rectangle get_bounds(const drawing::rectangle& rect);
140
150 static int32 get_standard_pixels_per_inch();
151
155 static drawing::rectangle get_working_area(const control& control);
156
160 static drawing::rectangle get_working_area(intptr handle);
161
165 static drawing::rectangle get_working_area(const drawing::point& point);
166
170 static drawing::rectangle get_working_area(const drawing::rectangle& rect);
172
173 private:
174 screen() = default;
175 screen(int32 bits_per_pixel, const drawing::rectangle& bounds, const xtd::ustring& device_name, int32 pixels_per_inch, bool primary, double scale_factor, const drawing::rectangle& working_area);
176
177 int32 bits_per_pixel_ = 0;
178 drawing::rectangle bounds_;
179 xtd::ustring device_name_;
180 int32 pixels_per_inch_ = 96;
181 bool primary_ = false;
182 double scale_factor_ = 1.;
183 drawing::rectangle working_area_;
184 };
185 }
186}
Defines the base class for controls, which are components with visual representation.
Definition control.h:79
Represents a display device or multiple display devices on a single system.
Definition screen.h:30
int32 bits_per_pixel() const noexcept
Gets the number of bits of memory, associated with one pixel of data.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
intmax_t intptr
Represent a pointer or a handle.
Definition types.h:153
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::style_sheets::control class.