[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'ImgList' (#lcl)

TCustomImageListResolutions.FindBestToScaleFrom

Finds the image resolution with the best size for scaling to the target width.

Declaration

Source position: imglist.pp line 241

public function TCustomImageListResolutions.FindBestToScaleFrom(

  const ATargetWidth: Integer

):Integer;

Arguments

ATargetWidth

  

Target width for the scaled image resolution.

Function result

Source image resolution to use for scaling to the target width.

Description

FindBestToScaleFrom is an Integer function used to find the image resolution that is the best candidate for scaling images to the specified target width.

ATargetWidth contains the image width to locate in the resolutions stored in the container.

The return value contains the ordinal position for the image resolution selected as the source for images.

FindBestToScaleFrom calls the Find method to locate an existing image resolution that matches the value in ATargetWidth. If an existing image resolution is not found that uses the image width in ATargetWidth, the FindBestToCopyFrom method is called to search all resolutions for the best candidate for the target image width.

FindBestToScaleFrom is used in the implementation of the StretchDraw method in TCustomImageList.

See also

TCustomImageList.StretchDraw

  

Draws an image stretched to the dimensions for the target rectangle.


Version 4.0 Generated 2025-05-03 Home