Show: Delphi C++
Display Preferences

FMX.Printer.TPrinterDevice.ActiveDPIIndex

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ActiveDPIIndex: Integer read FActiveDPIIndex write SetActiveDPIIndex;

C++

__property int ActiveDPIIndex = {read=FActiveDPIIndex, write=SetActiveDPIIndex, nodefault};

Properties

Type Visibility Source Unit Parent
property public
FMX.Printer.pas
FMX.Printer.hpp
FMX.Printer TPrinterDevice

Description

Specifies the index of the current DPI used by this printer device.

You must always set ActiveDPIIndex before using the printer device for printing. Setting ActiveDPIIndex to a value of -1 will use the last selected DPI. The last selected DPI when starting the application is the default DPI provided by the system. Some platform APIs do not work when queried for the printer device's default DPI, therefore you can set the default DPI by setting ActiveDPIIndex to -1 only at the start of the application. The problem in this case is that, for some platforms, the size of the Canvas will not be adapted to correspond to the default DPI because querying from the APIs may not be possible.

The general rule and best practice is to always set the DPI before printing. Manually setting ActiveDPIIndex to -1 will cause the DPI property to return (0,0). Trying to set a new value to the ActiveDPIIndex of the active printer device while printing will cause an error.

See Also

Personal tools
In Other Languages
Previous Versions
Assistance