Monitor
Overview
The Monitor class provides functionality to manage and manipulate information about computer monitors. This class uses PySide6's QScreen object to access various properties and functions of the monitor.
Constructor
Initializes a Monitor object.
Parameters:
index
(int): Index of the monitorscreen
(QScreen): QScreen object corresponding to the monitor
Methods
Captures the monitor screen.
Parameters:
save_path
(str): Path to save the captured imagex
(Optional[int]): Starting x-coordinate for capture (default: None)y
(Optional[int]): Starting y-coordinate for capture (default: None)width
(Optional[int]): Width of the area to capture (default: None)height
(Optional[int]): Height of the area to capture (default: None)
Returns:
str: Path of the saved image
None: If capture fails
Returns a dictionary containing all information about the monitor.
Returns: dict: Dictionary containing monitor information
Checks if the current monitor is the primary monitor.
Returns: bool: True if primary monitor, False otherwise
Returns the size of the monitor.
Returns: dict: Dictionary with 'width' and 'height' keys
Returns the geometry information of the monitor.
Returns: dict: Dictionary with 'x', 'y', 'width', 'height' keys
Returns the geometry information of the available monitor area.
Returns: dict: Dictionary with 'x', 'y', 'width', 'height' keys
Returns the size of the available monitor area.
Returns: dict: Dictionary with 'width' and 'height' keys
Returns the geometry information of the monitor in virtual desktop.
Returns: dict: Dictionary with 'x', 'y', 'width', 'height' keys
Returns the size of the monitor in virtual desktop.
Returns: dict: Dictionary with 'width' and 'height' keys
Returns the geometry information of the available virtual desktop area.
Returns: dict: Dictionary with 'x', 'y', 'width', 'height' keys
Returns the size of the available virtual desktop area.
Returns: dict: Dictionary with 'width' and 'height' keys
Returns the physical size of the monitor.
Returns: dict: Dictionary with 'width' and 'height' keys
Returns the color depth of the monitor.
Returns: int: Color depth of the monitor
Returns the device pixel ratio of the monitor.
Returns: float: Device pixel ratio
Returns the logical DPI of the monitor.
Returns: float: Logical DPI
Returns the horizontal logical DPI of the monitor.
Returns: float: Horizontal logical DPI
Returns the vertical logical DPI of the monitor.
Returns: float: Vertical logical DPI
Returns the orientation of the monitor.
Returns: str: Monitor orientation ('Portrait', 'Landscape', etc.)
Returns the physical DPI of the monitor.
Returns: float: Physical DPI
Returns the horizontal physical DPI of the monitor.
Returns: float: Horizontal physical DPI
Returns the vertical physical DPI of the monitor.
Returns: float: Vertical physical DPI
Returns the refresh rate of the monitor.
Returns: float: Monitor refresh rate (Hz)
Returns the manufacturer of the monitor.
Returns: str: Monitor manufacturer name
Returns the model of the monitor.
Returns: str: Monitor model name
Returns the name of the monitor.
Returns: str: Monitor name
Returns the serial number of the monitor.
Returns: str: Monitor serial number
Sets a callback for monitor geometry change events.
Parameters:
callback
(Callable): Function to be called when geometry changes
Sets a callback for monitor orientation change events.
Parameters:
callback
(Callable): Function to be called when orientation changes
Sets a callback for monitor refresh rate change events.
Parameters:
callback
(Callable): Function to be called when refresh rate changes
Last updated