Displays Class Reference
juce_gui_basics » desktop

Manages details about connected display devices. More...

## Classes

struct | Display
| Represents a connected display device. More...

## Public Member Functions

Rectangle< int > | physicalToLogical (Rectangle< int >, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts a Rectangle from physical to logical pixels. More...
Rectangle< int > | logicalToPhysical (Rectangle< int >, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts a Rectangle from logical to physical pixels. More...
template<typename ValueType >
Point< ValueType > | physicalToLogical (Point< ValueType >, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts a Point from physical to logical pixels. More...
template<typename ValueType >
Point< ValueType > | logicalToPhysical (Point< ValueType >, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts a Point from logical to physical pixels. More...
const Display & | findDisplayForRect (Rectangle< int >, bool isPhysical=false) const noexcept
| Returns the Display object representing the display containing a given Rectangle (either in logical or physical pixels). More...
const Display & | findDisplayForPoint (Point< int >, bool isPhysical=false) const noexcept
| Returns the Display object representing the display containing a given Point (either in logical or physical pixels). More...
const Display & | getMainDisplay () const noexcept
| Returns the Display object representing the display acting as the user's main screen. More...
RectangleList< int > | getRectangleList (bool userAreasOnly) const
| Returns a RectangleList made up of all the displays in LOGICAL pixels. More...
Rectangle< int > | getTotalBounds (bool userAreasOnly) const
| Returns the smallest bounding box which contains all the displays in LOGICAL pixels. More...

## Public Attributes

Array< Display > | displays
| An Array containing the Display objects for all of the connected displays. More...

## Detailed Description

Manages details about connected display devices.

## Member Function Documentation

## physicalToLogical() [1/2]

Rectangle<int> Displays::physicalToLogical | ( | Rectangle< int > | ,
|  | const Display * | useScaleFactorOfDisplay = `nullptr`
| ) |  | const

noexcept

Converts a Rectangle from physical to logical pixels.

If useScaleFactorOfDisplay is not null then its scale factor will be used for the conversion regardless of the display that the Rectangle to be converted is on.

## logicalToPhysical() [1/2]

Rectangle<int> Displays::logicalToPhysical | ( | Rectangle< int > | ,
|  | const Display * | useScaleFactorOfDisplay = `nullptr`
| ) |  | const

noexcept

Converts a Rectangle from logical to physical pixels.

If useScaleFactorOfDisplay is not null then its scale factor will be used for the conversion regardless of the display that the Rectangle to be converted is on.

## physicalToLogical() [2/2]

template<typename ValueType >

Point<ValueType> Displays::physicalToLogical | ( | Point< ValueType > | ,
|  | const Display * | useScaleFactorOfDisplay = `nullptr`
| ) |  | const

noexcept

Converts a Point from physical to logical pixels.

## logicalToPhysical() [2/2]

template<typename ValueType >

Point<ValueType> Displays::logicalToPhysical | ( | Point< ValueType > | ,
|  | const Display * | useScaleFactorOfDisplay = `nullptr`
| ) |  | const

noexcept

Converts a Point from logical to physical pixels.

## findDisplayForRect()

const Display& Displays::findDisplayForRect | ( | Rectangle< int > | ,
|  | bool | isPhysical = `false`
| ) |  | const

noexcept

Returns the Display object representing the display containing a given Rectangle (either in logical or physical pixels).

If the Rectangle lies outside all the displays then the nearest one will be returned.

## findDisplayForPoint()

const Display& Displays::findDisplayForPoint | ( | Point< int > | ,
|  | bool | isPhysical = `false`
| ) |  | const

noexcept

Returns the Display object representing the display containing a given Point (either in logical or physical pixels).

If the Point lies outside all the displays then the nearest one will be returned.

## getMainDisplay()

const Display& Displays::getMainDisplay | ( |  | ) | const

noexcept

Returns the Display object representing the display acting as the user's main screen.

## getRectangleList()

RectangleList<int> Displays::getRectangleList | ( | bool | userAreasOnly | ) | const

Returns a RectangleList made up of all the displays in LOGICAL pixels.

## getTotalBounds()

Rectangle<int> Displays::getTotalBounds | ( | bool | userAreasOnly | ) | const

Returns the smallest bounding box which contains all the displays in LOGICAL pixels.

## Member Data Documentation

## displays

Array<Display> Displays::displays

An Array containing the Display objects for all of the connected displays.

The documentation for this class was generated from the following file:

- juce_Displays.h