Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi TPngImageList save/load from file

I'd like to load and save TPngImageList (Delphi7 version, PngComponents) from/to file (better single PNG file for all 20 png icons in image list). I can't find LoadFromFile/SaveToFile methods.

How to do it?

like image 400
Prog1020 Avatar asked Oct 31 '22 19:10

Prog1020


1 Answers

TPngImageList derives from TImageList, which does not support that for bitmaps/icons, and TPngImageList does not add support for it for pngs.

You will have to load the file into a TPNGImage first, then manually split it (which is not easy, if transparency/alpha is involved) into pieces that you can Add() into the TPngImageList.

like image 142
Remy Lebeau Avatar answered Nov 17 '22 02:11

Remy Lebeau