This class provides screen functionalities.
More...
#include <Screen.h>
|
| static int | primaryDisplayWidth () |
| | Returns the width of the primary display in pixel.
|
| |
| static int | primaryDisplayHeight () |
| | Returns the height of the primary display in pixel.
|
| |
| static int | virtualDisplayWidth () |
| | Returns the width of the virtual display in pixel.
|
| |
| static int | virtualDisplayHeight () |
| | Returns the height of the virtual display in pixel.
|
| |
| static CV::PixelBoundingBoxI | virtualDisplayBoundingBox () |
| | Returns the bounding box of the virtual display with pixel resolution.
|
| |
| static CV::PixelPositionI | suitableWindowPosition (const unsigned int windowWidth, const unsigned int windowHeight, const int left=NumericT< int >::minValue(), const int top=NumericT< int >::minValue(), const HWND parent=nullptr) |
| | Returns the most suitable top left position of a window that has to be placed on the (virtual) screen.
|
| |
| static unsigned int | screens () |
| | Returns the number of installed screens.
|
| |
| static bool | screen (const unsigned int positionX, const unsigned int positionY, unsigned int &left, unsigned int &top, unsigned int &width, unsigned int &height) |
| | Returns the position and dimension of the screen most suitable for a given cursor point.
|
| |
| static bool | screen (const HWND window, unsigned int &left, unsigned int &top, unsigned int &width, unsigned int &height) |
| | Returns the position and dimension of the screen most suitable for a given window handle.
|
| |
| static int | dpi (const HDC dc) |
| | Returns the current DPI value of a given device context.
|
| |
| static double | scaleFactor (const HDC dc) |
| | Returns the scaling factor transforming the number of (backing) pixels defined in the (virtual) display coordinate system to the number of pixels defined in the (native/physical) screen coordinate system for a specified device context.
|
| |
| static int | scalePixel (const int pixel, const HDC dc) |
| | Converts a given pixel value defined in the (virtual) display coordinate system to the pixel value defined in the (native/physical) screen coordinate system.
|
| |
| static int | scalePixelByFactor (const int pixel, const double scaleFactor) |
| | Converts a given pixel value by a given scale factor.
|
| |
This class provides screen functionalities.
◆ dpi()
| static int Ocean::Platform::Win::Screen::dpi |
( |
const HDC |
dc | ) |
|
|
static |
Returns the current DPI value of a given device context.
If no context is given, the desktop DC is used instead. A DPI value of 96 complies with a 100 percent scaling, 192 DPI complies with 200 percent scaling
- Parameters
-
| dc | The device context, nullptr to determine the scale factor of the default screen |
- Returns
- The resulting DPI value, with range (0, infinity)
◆ primaryDisplayHeight()
| static int Ocean::Platform::Win::Screen::primaryDisplayHeight |
( |
| ) |
|
|
static |
Returns the height of the primary display in pixel.
- Returns
- Primary display height in pixel
◆ primaryDisplayWidth()
| static int Ocean::Platform::Win::Screen::primaryDisplayWidth |
( |
| ) |
|
|
static |
Returns the width of the primary display in pixel.
- Returns
- Primary display width in pixel
◆ scaleFactor()
| static double Ocean::Platform::Win::Screen::scaleFactor |
( |
const HDC |
dc | ) |
|
|
static |
Returns the scaling factor transforming the number of (backing) pixels defined in the (virtual) display coordinate system to the number of pixels defined in the (native/physical) screen coordinate system for a specified device context.
- Parameters
-
| dc | The device context, nullptr to determine the scale factor of the default screen |
- Returns
- The resulting scale factor with range (0, infinity)
◆ scalePixel()
| int Ocean::Platform::Win::Screen::scalePixel |
( |
const int |
pixel, |
|
|
const HDC |
dc |
|
) |
| |
|
inlinestatic |
Converts a given pixel value defined in the (virtual) display coordinate system to the pixel value defined in the (native/physical) screen coordinate system.
- Parameters
-
| pixel | Pixel value to convert, with range (-infinity, infinity) |
| dc | The device context, nullptr to determine the scale factor of the default screen |
- Returns
- The converted pixel value for the (native/pyhsical) screen coordinate system, with range (-infinity, infinity)
◆ scalePixelByFactor()
| int Ocean::Platform::Win::Screen::scalePixelByFactor |
( |
const int |
pixel, |
|
|
const double |
scaleFactor |
|
) |
| |
|
inlinestatic |
Converts a given pixel value by a given scale factor.
- Parameters
-
| pixel | Pixel value to convert, with range (-infinity, infinity) |
| scaleFactor | The scale factor to be applied, with range (-infinity, infinity) |
- Returns
- The resulting converted pixel value (-infinity, infinity)
◆ screen() [1/2]
| static bool Ocean::Platform::Win::Screen::screen |
( |
const HWND |
window, |
|
|
unsigned int & |
left, |
|
|
unsigned int & |
top, |
|
|
unsigned int & |
width, |
|
|
unsigned int & |
height |
|
) |
| |
|
static |
Returns the position and dimension of the screen most suitable for a given window handle.
- Parameters
-
| window | Window handle to receive the screen for |
| left | Left screen position, pixel in virtual coordinate space |
| top | Top screen position, pixel in virtual coordinate space |
| width | Screen width, in pixel |
| height | Screen height, in pixel |
- Returns
- True, if succeeded
◆ screen() [2/2]
| static bool Ocean::Platform::Win::Screen::screen |
( |
const unsigned int |
positionX, |
|
|
const unsigned int |
positionY, |
|
|
unsigned int & |
left, |
|
|
unsigned int & |
top, |
|
|
unsigned int & |
width, |
|
|
unsigned int & |
height |
|
) |
| |
|
static |
Returns the position and dimension of the screen most suitable for a given cursor point.
- Parameters
-
| positionX | Horizontal cursor position to receive the screen for |
| positionY | Vertical cursor position to receive the screen for |
| left | Left screen position, pixel in virtual coordinate space |
| top | Top screen position, pixel in virtual coordinate space |
| width | Screen width, in pixel |
| height | Screen height, in pixel |
- Returns
- True, if succeeded
◆ screens()
| static unsigned int Ocean::Platform::Win::Screen::screens |
( |
| ) |
|
|
static |
Returns the number of installed screens.
- Returns
- Screen number
◆ suitableWindowPosition()
| static CV::PixelPositionI Ocean::Platform::Win::Screen::suitableWindowPosition |
( |
const unsigned int |
windowWidth, |
|
|
const unsigned int |
windowHeight, |
|
|
const int |
left = NumericT< int >::minValue(), |
|
|
const int |
top = NumericT< int >::minValue(), |
|
|
const HWND |
parent = nullptr |
|
) |
| |
|
static |
Returns the most suitable top left position of a window that has to be placed on the (virtual) screen.
The final position ensures that the window lies inside the bounding box of the (virtual) screen.
- Parameters
-
| windowWidth | The width of the window for which the position will be determined in pixel, with range (0, infinity) |
| windowHeight | The height of the window for which the pose will be determined in pixel, with range (0, infinity) |
| left | Optional proposed left position of the window, which will be adjusted to fit into the virtual screen |
| top | Optional proposed top position of the window, which will be adjusted to fit into the virtual screen |
| parent | Optional handle of a parent (or associated) window to which the resulting position should match if no proposed position is provided |
- Returns
- The resulting top left position of the window
◆ virtualDisplayBoundingBox()
Returns the bounding box of the virtual display with pixel resolution.
- Returns
- The bounding box of the virtual display
◆ virtualDisplayHeight()
| static int Ocean::Platform::Win::Screen::virtualDisplayHeight |
( |
| ) |
|
|
static |
Returns the height of the virtual display in pixel.
The virtual display is bounded by all screens.
- Returns
- Virtual display height in pixel
◆ virtualDisplayWidth()
| static int Ocean::Platform::Win::Screen::virtualDisplayWidth |
( |
| ) |
|
|
static |
Returns the width of the virtual display in pixel.
The virtual display is bounded by all screens.
- Returns
- Virtual display width in pixel
The documentation for this class was generated from the following file: