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 {
32 class forms_export_ screen : public object {
33 public:
35 screen(const screen&) = default;
36 screen& operator =(const screen&) = default;
38
40
45 int32 bits_per_pixel() const noexcept;
46
49 const drawing::rectangle& bounds() const noexcept;
50
54 const xtd::string& device_name() const;
55
58 bool high_resolution() const noexcept;
59
63 int32 pixels_per_inch() const noexcept;
64
67 bool primary() const noexcept;
68
74 double scale_factor() const noexcept;
75
80 const drawing::rectangle& working_area() const noexcept;
82
84
88 static std::vector<screen> all_screens();
89
93 static screen primary_screen();
95
97
101 static drawing::graphics create_graphics();
102
106 static screen from_control(const control& control);
107
111 static screen from_handle(intptr handle);
112
116 static screen from_point(const drawing::point& point);
117
121 static screen from_rectangle(const drawing::rectangle& rect);
122
126 static drawing::rectangle get_bounds(const control& control);
127
131 static drawing::rectangle get_bounds(intptr handle);
132
136 static drawing::rectangle get_bounds(const drawing::point& point);
137
141 static drawing::rectangle get_bounds(const drawing::rectangle& rect);
142
152 static int32 get_standard_pixels_per_inch();
153
157 static drawing::rectangle get_working_area(const control& control);
158
162 static drawing::rectangle get_working_area(intptr handle);
163
167 static drawing::rectangle get_working_area(const drawing::point& point);
168
172 static drawing::rectangle get_working_area(const drawing::rectangle& rect);
174
175 private:
176 screen() = default;
177 screen(int32 bits_per_pixel, const drawing::rectangle& bounds, const xtd::string& device_name, int32 pixels_per_inch, bool primary, double scale_factor, const drawing::rectangle& working_area);
178
179 int32 bits_per_pixel_ = 0;
180 drawing::rectangle bounds_;
181 xtd::string device_name_;
182 int32 pixels_per_inch_ = 96;
183 bool primary_ = false;
184 double scale_factor_ = 1.;
185 drawing::rectangle working_area_;
186 };
187 }
188}
Defines the base class for controls, which are components with visual representation.
Definition control.h:81
Represents a display device or multiple display devices on a single system.
Definition screen.h:32
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:42
#define forms_export_
Define shared library export.
Definition forms_export.h:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.h:23
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.