Loading...
Searching...
No Matches
juce::Displays Class Reference

## Detailed Description

Manages details about connected display devices.

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

- juce_gui_basics/desktop/juce_Displays.h

## Classes

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

## Public Member Functions

Rectangle< int > | physicalToLogical (Rectangle< int > physicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts an integer Rectangle from physical to logical pixels.
Rectangle< float > | physicalToLogical (Rectangle< float > physicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts a floating-point Rectangle from physical to logical pixels.
Rectangle< int > | logicalToPhysical (Rectangle< int > logicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts an integer Rectangle from logical to physical pixels.
Rectangle< float > | logicalToPhysical (Rectangle< float > logicalRect, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts a floating-point Rectangle from logical to physical pixels.
template<typename ValueType>
Point< ValueType > | physicalToLogical (Point< ValueType > physicalPoint, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts a Point from physical to logical pixels.
template<typename ValueType>
Point< ValueType > | logicalToPhysical (Point< ValueType > logicalPoint, const Display *useScaleFactorOfDisplay=nullptr) const noexcept
| Converts a Point from logical to physical pixels.
const Display * | getDisplayForRect (Rectangle< int > rect, bool isPhysical=false) const noexcept
| Returns the Display object representing the display containing a given Rectangle (either in logical or physical pixels), or nullptr if there are no connected displays.
const Display * | getDisplayForPoint (Point< int > point, bool isPhysical=false) const noexcept
| Returns the Display object representing the display containing a given Point (either in logical or physical pixels), or nullptr if there are no connected displays.
const Display * | getPrimaryDisplay () const noexcept
| Returns the Display object representing the display acting as the user's main screen, or nullptr if there are no connected displays.
RectangleList< int > | getRectangleList (bool userAreasOnly) const
| Returns a RectangleList made up of all the displays in LOGICAL pixels.
Rectangle< int > | getTotalBounds (bool userAreasOnly) const
| Returns the smallest bounding box which contains all the displays in LOGICAL pixels.

## Public Attributes

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

## Member Functions

## physicalToLogical() [1/3]

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

noexcept

Converts an integer 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.

Referenced by physicalToLogical(), and physicalToLogical().

## physicalToLogical() [2/3]

Rectangle< float > juce::Displays::physicalToLogical | ( | Rectangle< float > | physicalRect,
|  | const Display * | useScaleFactorOfDisplay = nullptr ) const

noexcept

Converts a floating-point 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.

References physicalToLogical().

## logicalToPhysical() [1/3]

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

noexcept

Converts an integer 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.

References logicalToPhysical().

Referenced by logicalToPhysical(), logicalToPhysical(), and logicalToPhysical().

## logicalToPhysical() [2/3]

Rectangle< float > juce::Displays::logicalToPhysical | ( | Rectangle< float > | logicalRect,
|  | const Display * | useScaleFactorOfDisplay = nullptr ) const

noexcept

Converts a floating-point 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.

References logicalToPhysical().

## physicalToLogical() [3/3]

template<typename ValueType>

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

noexcept

Converts a Point 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 Point to be converted is on.

References physicalToLogical().

## logicalToPhysical() [3/3]

template<typename ValueType>

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

noexcept

Converts a Point 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 Point to be converted is on.

References logicalToPhysical().

## getDisplayForRect()

const Display * juce::Displays::getDisplayForRect | ( | Rectangle< int > | rect,
|  | bool | isPhysical = false ) const

noexcept

Returns the Display object representing the display containing a given Rectangle (either in logical or physical pixels), or nullptr if there are no connected displays.

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

References getDisplayForRect().

Referenced by getDisplayForRect().

## getDisplayForPoint()

const Display * juce::Displays::getDisplayForPoint | ( | Point< int > | point,
|  | bool | isPhysical = false ) const

noexcept

Returns the Display object representing the display containing a given Point (either in logical or physical pixels), or nullptr if there are no connected displays.

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

References getDisplayForPoint().

Referenced by getDisplayForPoint().

## getPrimaryDisplay()

const Display * juce::Displays::getPrimaryDisplay | ( |  | ) | const

noexcept

Returns the Display object representing the display acting as the user's main screen, or nullptr if there are no connected displays.

References getPrimaryDisplay().

Referenced by getPrimaryDisplay(), and juce::StandaloneFilterWindow::StandaloneFilterWindow().

## getRectangleList()

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

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

References getRectangleList().

Referenced by getRectangleList().

## getTotalBounds()

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

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

References getTotalBounds().

Referenced by getTotalBounds().

## Member Data Documentation

## displays

Array<Display> juce::Displays::displays

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

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited