FMX.ImgList.TCustomImageList.BestSize

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function BestSize(const Index: Integer; var Size: TSize): Boolean; overload;
function BestSize(const Index: Integer; var Size: TSizeF): Boolean; overload;

C++

bool __fastcall BestSize(const int Index, System::Types::TSize &Size)/* overload */;
bool __fastcall BestSize(const int Index, System::Types::TSizeF &Size)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
FMX.ImgList.pas
FMX.ImgList.hpp
FMX.ImgList TCustomImageList

Description

Returns the maximum size of rectangles from all layers of the specified Index image in the destination collection, that is less than the specified Size.

BestSize returns the maximum size of the rectangles from all layers of the specified Index image in the destination collection. The Width and Height of this rectangle should be less than the width and height of the specified Size.

If TLayer.MultiResBitmap has multiple images for different scales, then the search is performed among all images.

Index is the index of an image in the TCustomImageList.Destination collection. For this image, it determines the suitable size.

Size passes to BestSize the maximum possible values of Width and Height. It returns the most suitable values.

BestSize returns True if successful, otherwise it returns False. If BestSize returns False, then Size does not change.

BestSize is called from TGlyphColumn.GlyphPlaceIntoBounds. The obtained Size is used as a rectangle for painting in the cells of the TGlyphColumn control.

See Also