Skip to content

Create a FireMonkey TImageList by importing all images in a folder.

License

Notifications You must be signed in to change notification settings

DeveloppeurPascal/Folder2FMXImageList

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Folder 2 FMX Image List

Create a FireMonkey TImageList by importing all images in a folder.

How to use Folder2FMXImageList ?

  • Buy last release of the program, compile one from last source files or compile one from the releases.

  • 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.

What does Folder2FMXImageList ?

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.

File name and scale

I based the file name split in Adobe Illustrator default export format :

Adobe Illustrator homothetic export sample

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.

Possible errors

If you have the same image filename in multiple subfolders of the path you specified during the same import, it will raise an exception.

Comments

If you use this program, please add a star to its repository and think about sponsoring me on Zone Abo, Patreon, Liberapay or by buying a license.

You can follow all my coding activites online, projects and courses at Zone Abo.

For any comment, new feature or bug, please open an issue.