This sample shows how to use FireMonkey image lists. In the Using TImageList Image Lists as Centralized Collections of Images tutorial, this example is used:
- To demonstrate how to use the Image List Editor.
- To describe the code implementing the ActnNextImageExecute event handler of the OnExecute event assigned to the Add New Source button. This button adds, to an image in the Destination collection, a new layer and creates a new multi-resolution bitmap in this layer.
- To describe the code implementing the ActnUpdateTextExecute event handler of the OnExecute event assigned to the Update Text button. This button draws the specified text over the main image in a layer.
- To describe the code demonstrating how to draw images from an image list on the surface of your own controls.
Table of Contents
You can find the ImageList sample project at:
- Start | Programs | Embarcadero RAD Studio Sydney | Samples and navigate to:
Object PascalMulti-Device SamplesUser InterfaceImageList
CPPMulti-Device SamplesUser InterfaceImageList
- Subversion Repository:
- You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.
Now click the first Image tab. This tab contains four types of the Next Image button. Each button shows the image. Click any of these buttons — check that the image containing the next index in the
ImageList1 image list is drawn in each button. Note that in the Object Inspector, each button shows both Images and ImageIndex properties. Try to change the ImageIndex value.
Bitmap and Image Tab
In the Demo of images application, click the Bitmap and Image tab. This tab contains several controls managing images in the images list:
- The Right and Left arrows increase or decrease the index of the image being shown.
- The Up Cache Size and Down Cache Size buttons increase or decrease the CacheSize property on
- The Clear Cache button to clear the internal cache.
- The Dormant check box sets or clears whether the actual image is stored with this bitmap item (the Dormant property).
- The Add New Source button creates a new image and adds it to the image list.
- The Update Text button demonstrates the drawing of a text over the current image.
- The Right and Left arrow buttons draw the next or previous image from the
ImageList1image list over the None caption of the None tab.
Now click the first Bitmap tab. This tab contains three list controls:
TreeView1. These list controls show the Images property – in the Object Inspector – in which you can select an image list to use. Notice that each item control in these lists shows the ImageIndex property – in the Object Inspector – in which you can select a number (index) of an image in the image list. Try to change the ImageIndex value.
Now click the last None tab. This tab contains the Add Items, Add Items with Bitmap, and Add Bitmap and Image buttons adding into the
ListView2: TListView; list view a new item showing the
Image1.Bitmap bitmap and/or images from the
ImageList1 image list. The Clear Items button clears all items from the
ListView2. The Images check box switches showing or hiding images from the
ImageList1 image list.
You can check the original post via the link below:
Head over and check out the full source code for the ImageList sample for Delphi on GitHub.
Check out the full C++ source code for the image list tutorial over on GitHub.
Next, find out how you can use your own implementation with list C++ views and Tools API support.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition