How can I load a PNG image from a resource to a TImage at runtime ?
The TImage.Picture
has no LoadFromResourceName
method. But it can load a PNG at design time !
I tried [TImage].Picture.Bitmap.LoadFromResourceName(HInstance, 'BALANCE_OFF');
... but it says "Resurce BALANCE_OFF not found.". But it's there !
.rc file looks like this:
BKG_TEXTURE BITMAP "BKG_TEXTURE.BMP"
BKG_FOTO RCDATA "BKG_FOTO.PNG"
BALANCE_ON RCDATA "BALANCE_ON.PNG"
BALANCE_OFF RCDATA "BALANCE_OFF.PNG"