[Overview][Types][Classes][Procedures and functions][Index] |
Image width needed for the specified display density.
Source position: imglist.pp line 409
public property TCustomImageList.WidthForPPI[AImageWidth: Integer,APPI: Integer] : Integer |
WidthForPPI is an indexed read-only Integer property that contains the image width needed for images using the specified display density (Pixels per Inch).
AImageWidth is an Integer value that contains the initial image width used for the calculated width at the specified display density.
APPI is an Integer value that contains the display density used to calculate the width of images.
Reading the value for the property causes the image width to be calculated using the specified parameter values. If AWidth is 0 (zero) or a negative number, the value in the Width property is used as the initial image width. When Scaled contains True, the image width is calculated using the following formula:
(AImageWidth * APPI) / 96
If an image resolution does not already exist which uses the derived image width, the display density in APPI is used as a threshold for scaling using the following criteria:
Display Density (PPI) | Scaling Factor (%) |
96-120 | 100% |
121-168 | 150% |
169 and higher | Calculated using (APPI / 96) * 100 |
The property value contains the image width derived using the formula:
AImageWidth * Factor div 100
When Scaled is False, image width scaling is not performed and the value in AImageWidth is used as the property value.
The OnGetWidthForPPI event handler is signalled (when assigned) to allow overriding the calculated image width. Applications can provide a TCustomImageListGetWidthForPPI procedure which uses custom scaling logic, or performs simple image width substitution for given display densities.
|
Indicates if images are automatically scaled for missing resolutions. |
|
|
Event handler used to override the scaled width for a display density. |
|
|
Specifies an event handler used to get image widths for a display density (PPI). |