Event handler used to override the scaled width for a display density.
Source position: imglist.pp line 425
public property TCustomImageList.OnGetWidthForPPI : TCustomImageListGetWidthForPPI |
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;
|
Specifies an event handler used to get image widths for a display density (PPI). |
|
|
Image width needed for the specified display density (PPI). |
Lazarus Component Library (LCL) | Version 3.99-1b97b99691 (2024-09-01) | Home |