[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TMonitor.PixelsPerInch

Contains the Pixels Per Inch (or display density) for the monitor.

## Declaration

Source position: forms.pp line 1084

`public property TMonitor.PixelsPerInch : Integer read GetPixelsPerInch;`

## Description

PixelsPerInch is a read-only Integer property with the display density for the monitor. The property value is determined by calling the GetDpiForMonitor routine for the widgetset to retrieve the effective dots-per-inch for both horizontal and vertical dimensions. The horizontal density is used in the property value.

If the GetDpiForMonitor routine does not complete successfully, the PixelsPerInch property in TScreen is used as the property value.

PixelsPerInch can be used at run-time to ensure that the display density for a Font or Canvas matches the setting in a specific monitor. It is used in the Show and AutoScale methods in TCustomForm to apply an auto-adjust layout policy. It is also used in the form designer for the Lazarus IDE to perform similar actions during component streaming.

## See also

TCustomForm.Show |  | Displays the form instance with support for High DPI scaling.
TCustomForm.AutoScale |  | Sets scaled to True and calls AutoAdjustLayout with the current PPI for the monitor.