INNOVA Solutions

A FireMonkey Image List

A Component to Manage Images Dynamically in Firemonkey Applications

Early Days.


A Google Search for "delphi firemonkey imagelist" produces a weird range of work arounds to provide images for dynamic use in FireMonkey applications

In the VCL a Windows Image resource is wrapped in a TImageList and these images can be automatically shared between menus via actionlists. The image list also provides a repository for the images (Eg the fileopen fileclosed images) in Treeviews etc. There is much gnashing of teeth that this is not available in FMX.

The FMXImageList is my approach to this lack of a TImageList. It is a work in progress and I expect to refine the "Helper" methods which link images to other components as time progresses.

The aim is to provide an easy way to add a range of images to the form's resource file and to allow them to be used dynamically within the application to flag file types, Node status etc.

Usage Notes TFMXImageList

Compile and install the two package (.dpk) files supplied. They contain the TFMXImageList component and a separate Component editor. These packages when installed in the IDE should put the TFMXImageList on your tool pallet under Innova Solutions.

When an FMXObject which contains a TImage with the StyleName 'image' or 'listimage' is assigned to the FMXImageList using AssignAnImageTo(AControl: TControl; AImageIndex: Integer) the Image at AImageIndex is assigned to that TImage.

Some controls (TListView) have the 'image' as part of their style and can often be assigned directly..

For other components you need to place the image component in the "Style" by editing the Default Style or creating a Custom Style. Use the Style Editor to place the image and the Object Inspector to enter the StyleName property. The StyleName of 'image' and 'listimage' are both supported to allow for styles which may use 'image' for another purpose.
Note: If you want to make the image a "live" part of the control you need to set its "HitTest" to false

If not already assigned the controls OnApplyStyleLookup is assigned to ensure the style is correctly refreshed as the component is scrolled etc. If you assign your own OnApplyStyleLookup then you may need to handle the refresh yourself, possibly by calling FMXImageList.DoApplyImageStyleLookup.

DownLoad Source

Zip File of all project source files

Online Documentation

Click Here for a more in depth look at this topic.

Updated Source Via GitHub

All Firemonkey DUnit and FMXImageList Code

Innova Solutions Presentations at ADUG

ADUG Presentations

The company accepts no liability for any alleged or actual damage arising from the use of any of these products or this information.

Home           Australian Delphi Users Group

INNOVA Solutions Pty Ltd - ACN 081 449 836