From b583b3fa04a23c046b70b4de64ddb2d4328a74db Mon Sep 17 00:00:00 2001
From: dsiders
+The OnGetWidthForPPI event handler is signalled (when assigned) to +allow the calculated image width to be overridden. Applications can provide a +TCustomImageListGetWidthForPPI procedure which uses custom scaling +logic, or performs simple image width substitution for a given display density.
See WidthForPPI for information @@ -6578,6 +6583,10 @@ about use of the pixels per inch setting to derive the scaling factor and the resulting size for images.
+The ResolutionForPPI property provides access to an image list using an image +size scaled to a specific PPI setting. +
+When Scaled is False, images are not dynamically scaled. The Width and Height specified in the image list are used.
@@ -6591,10 +6600,6 @@ resolutions used in the image list. At run-time, use the methods provided in the class instance to maintain the image list.-Use the OnGetWidthForPPI event handler to override or substitute the -image size used for a given display density (PPI). -
-Scaled is used in the implementation of the GetResolutionForPPI and GetWidthForPPI methods which implement the ResolutionForPPI and WidthForPPI properties (respectively). @@ -6679,6 +6684,16 @@ 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;
+