TImageList.OnGetWidthForPPI property
Event handler used to override the scaled width for a display density.
Declaration
property OnGetWidthForPPI:;Description
OnGetWidthForPPI is a
TCustomImageListGetWidthForPPI
property that implements the event handler signalled to get the width for
images using a specified display density (Pixels per Inch). OnGetWidthForPPI
allows an application to override image width values derived using the
automatic scaling features in
TCustomImageList.
OnGetWidthForPPI is signalled when the GetWidthForPPI method is
called, and when reading the value for the WidthForPPI property.
The event is the last action performed (when assigned) in the GetWidthForPPI
method. It can be used in situations where automatic image scaling is not
enable using the Scaled property. It can also be used when the automatic
scaling algorithm in GetWidthForPPI produces undesirable results (or
performance) for certain high density displays.
Assign an object procedure using the TCustomImageListGetWidthForPPI type to
the event handler which handles image width calculations or substitutions.
The image width is returned in the AResultWidth parameter for the
event handler.
For example:
procedure TForm1.ImageList1GetWidthForPPI(Sender: TCustomImageList; AImageWidth, APPI: Integer; var AResultWidth: Integer); begin AResultWidth := AImageWidth * APPI div 96; end;
This description is the one of ImgList.TCustomImageList.OnGetWidthForPPI.
See also
- TCustomImageListGetWidthForPPI
- WidthForPPI
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
