Create a FireMonkey TImageList by importing all images in a folder.
This code repository contains a project developed in Object Pascal language under Delphi. You don't know what Delphi is and where to download it ? You'll learn more on this web site.
Follow my development streams of software, video games, mobile applications and websites on my Twitch channel or as replays on Serial Streameur mostly in French.
This software is available in a directly installable or executable production version. It is distributed as shareware.
You can download and redistribute it free of charge, provided you do not modify its content (installer, program, additional files, etc.).
If you use this software regularly and are satisfied with it, you are invited to purchase an end-user license. Purchasing a license will give you access to software updates, as well as enabling optional features.
You can also visit the software website to find out more about how it works, access videos and articles, find out about the different versions available and their features, contact user support...
-
Specify the folder path were are your images.
-
Choose your export method (clipboard or TDataModule unit).
-
In case you choosed the clipboard, just paste the result to Delphi form editor on a TForm, TFrame or (better choice) TDataModule in a FireMonkey Project.
-
In case you choosed TDataModule unit export, just include it to a FireMonkey project like you does with any other unit.
-
You can drag & drop folders to the source directory path to export each of them as a TDataModule unit.
The program searches all PNG files in a folder and its subfolders.
It creates a TImageList and adds the files as "Source". Each file is imported as it, with scale 1 if no scale is specified in its name.
After filling the TImageList.Source property, the program creates a Destination for each Source image.
Then, depending on your export method, the program serialize the TImageList and copy it to the clipboard or generate a TDataModule unit and save it on disk in the images folder.
I based the file name split on Adobe Illustrator default export format :
xxx.png will create a source named "xxx" with scale 1 xxx@3x.png will create a source named "xxx" with scale 3 xxx@1.5x.png will create a source named "xxx" with scale 1,5
The program don't verify bitmap sizes. If the scale is not the good one, this will impact the display of bitmaps in your programs.
If you have the same image filename in multiple subfolders of the path you specified during the same import, it will raise an exception.
To download this code repository, we recommend using "git", but you can also download a ZIP file directly from its GitHub repository.
This project uses dependencies in the form of sub-modules. They will be absent from the ZIP file. You'll have to download them by hand.
- DeveloppeurPascal/AboutDialog-Delphi-Component must be installed in the ./lib-externes/AboutDialog-Delphi-Component subfolder.
- DeveloppeurPascal/librairies must be installed in the ./lib-externes/librairies subfolder.
As an Embarcadero MVP, I benefit from the latest versions of Delphi and C++ Builder in RAD Studio as soon as they are released. I therefore work with these versions.
Normally, my libraries and components should also run on at least the current version of Delphi Community Edition.
There's no guarantee of compatibility with earlier versions, even though I try to keep my code clean and avoid using too many of the new ways of writing in it (type inference, inline var and multiline strings).
If you detect any anomalies on earlier versions, please don't hesitate to report them so that I can test and try to correct or provide a workaround.
This source code is distributed under the AGPL 3.0 or later license.
You are generally free to use the contents of this code repository anywhere, provided that:
- you mention it in your projects
- distribute the modifications made to the files supplied in this project under the AGPL license (leaving the original copyright notices (author, link to this repository, license) which must be supplemented by your own)
- to distribute the source code of your creations under the AGPL license.
If this license doesn't suit your needs, you can purchase the right to use this project under the Apache License 2.0 or a dedicated commercial license (contact the author to explain your needs).
These source codes are provided as is, without warranty of any kind.
Certain elements included in this repository may be subject to third-party usage rights (images, sounds, etc.). They are not reusable in your projects unless otherwise stated.
If you want an answer from the project owner the best way to ask for a new feature or report a bug is to go to the GitHub repository and open a new issue.
If you found a security issue please don't report it publicly before a patch is available. Explain the case by sending a private message to the author.
You also can fork the repository and contribute by submitting pull requests if you want to help. Please read the CONTRIBUTING.md file.
If you think this project is useful and want to support it, please make a donation to its author. It will help to maintain the code and binaries.
You can use one of those services :
or if you speack french you can subscribe to Zone Abo on a monthly or yearly basis and get a lot of resources as videos and articles.