Vcl.Controls.TControl.ScaleForPPI
Delphi
procedure ScaleForPPI(NewPPI: Integer); virtual;
C++
virtual void __fastcall ScaleForPPI(int NewPPI);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Vcl.Controls.pas Vcl.Controls.hpp |
Vcl.Controls | TControl |
Description
Adjusts the scaling of the current control for the specified Pixels Per Inch (PPI). Additionally, it updates the PixelsPerInch and ScaleFactor properties.
Notes:
- We recommend using this method exclusively for scaling to the current displayed PPI. Attempting to scale to a different PPI may yield undesired outcomes in controls such as checkboxes, radio buttons, and others, as they are drawn by the operating system using the current PPI. This restriction does not apply to styled applications.
- The OnBeforeMonitorDpiChange and OnAfterMonitorDpiChanged events are not triggered when ScaleForPPI is employed. These events are specifically designed to respond to DPI changes originating from the WM_DPICHANGED message.