TCustomRuler.ScreenRes

<< Click to display table of contents >>

TCustomRuler.ScreenRes

The number of screen pixels that make up a logical inch.

property ScreenRes: Integer;

By default, this property is equal to the screen DPI (or DPI of a monitor that contains a form containing this ruler, if the application supports it (in Delphi 10.1+)).

Moreover, the component resets this property to the screen DPI (as described above) after loading from a form and on resizing. So, if you want to change value of this property, you need to reassign it in these cases.

However, it's highly not recommended to change value of this property. Allow the ruler to maintain it automatically. Change Zoom instead.

If you changed a value of the global RichViewPixelsPerInch variable (not recommended!), you need to update this property accordingly:

Ruler1.ScreenRes := RichViewPixelsPerInch;

This value affects not only sizes that this ruler measures, but also sizes of its visual elements (such as tab icons and thumbs), they are scaled from UnitsPixelsPerInch to ScreenRes.