I've got a form with a large TImage
on it as a background. Problem is, this is stored directly in the DFM as a bitmap, which takes up about 3 MB. The original PNG file is ~250K. I'd like to try to reduce bloat by embedding the PNG in a resource, and then having the form load it during OnCreate
. I can do that now that Delphi 2009 includes PNG support, except I don't quite know how to build a resource file with a PNG in it. Anyone know how that's done?
Delphi – How to make a PNG resource
delphidelphi-2009pngresources
Best Answer
Example text file (named myres.rc):
Added to project:
Example of loading at runtime: