The TImage.Picture.Graphic property is zero until you load the graphics in the Picture .
What you are asking for can be achieved as follows:
uses pngimage; Stream := TMemoryStream.Create; try // obtain png image, load from file or other.. .... Image := TPngImage.Create; try Stream.Position := 0; Image.LoadFromStream(Stream); Image1.Picture.Graphic := Image; finally Image.Free; end; finally Stream.Free; end;
source share