Prog1020
Prog1020

Reputation: 4781

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?

Upvotes: 5

Views: 1323

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 595349

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.

Upvotes: 2

Related Questions