I drop a TImage onto the Tabsheet and set the Picture property to my PNG
file. No problems so far. I can see the image on the tabsheet and it knows
about the transparency. I compile and run and the app displays the images
as expected.
I can switch to another project and back to this one and everything still
works.
However If I exit Delphi and start up again, when the form is loaded all the
PNG images have gone from the form! The TImage picture property is set back
to (None) and the Transparent property changed from True to False.
I have
uses
PngImages
in my uses clause, which was apparently added by Delphi..
I note that PngComponents uses PngImages but there is a newer version of
PngImages than the one he is using around.
TIA,
Ross
> I downloaded and installed PngComponents into BDS2006.
> I have a TPageControl with several tabsheets and I want
> to place a PNG image on each tabsheet.
PngComponents has its own TPngImageList component. You should use that to
store your images, and then assign them to the TImage at runtime when
needed.
> I drop a TImage onto the Tabsheet and set the Picture property to my PNG
> file. No problems so far. I can see the image on the tabsheet and it
knows
> about the transparency. I compile and run and the app displays the images
> as expected.
> However If I exit Delphi and start up again, when the form is
> loaded all the PNG images have gone from the form! The
> TImage picture property is set back to (None) and the
> Transparent property changed from True to False.
The Png TGraphic class was likely not registered yet when the DFM was
streamed, so TImage didn't know how to handle the stored data.
Gambit
I am using TPngImageList successfully already. It seems to have no problems.
These images are all different sizes so presumably I can use
TPngImageCollection. How do I assign?
Image1.Picture := PNGImageCollection.Items [0]
I remember as giving a comile error.
Thanks.
Ross