TPngImage.LoadFromStream
I try to load an image (png) into a TfrxPictureView in the OnBeforePrint event. The png exists in a TMemoryStream (ms in the following code snippets).
This code works fine:
png := TPngImage.Create;
fn := 'c:\temp\1.png';
ms.SaveToFile(fn);
png.LoadFromFile(fn);
Picture1.Picture.Assign(png);
png.Free;
But I don't want to save the MemoryStream to file:
png := TPngImage.Create;
png.LoadFromStream(ms); // this function is not available
Picture1.Picture.Assign(png);
png.Free;
Is there a way to load the data from the MemoryStream into TfrxPictureView without saving it to file?
greetings
Gerhard
This code works fine:
png := TPngImage.Create;
fn := 'c:\temp\1.png';
ms.SaveToFile(fn);
png.LoadFromFile(fn);
Picture1.Picture.Assign(png);
png.Free;
But I don't want to save the MemoryStream to file:
png := TPngImage.Create;
png.LoadFromStream(ms); // this function is not available
Picture1.Picture.Assign(png);
png.Free;
Is there a way to load the data from the MemoryStream into TfrxPictureView without saving it to file?
greetings
Gerhard
Comments
Script code: