I have the following structure:
public
FBMP : TBitmap;
...
var
PNG : TPNGImage;
Stream : TMemoryStream;
begin
Stream := TMemoryStream.Create;
Stream.LoadFromFile('foo.png');
PNG := TPNGImage.Create;
PNG.LoadFromStream(Stream);
FBMP := TBitmap.Create;
FBMP.Assign(PNG);
PNG.Free;
Stream.Free;
end;
When I try to draw the image above, I realize that it does not recognize the semi-transparency of the PNG file (showing all opaque colors), a phenomenon that did not happen when I did not use the stream . But as the need arose to use the stream , there goes my question: how to enable transparency when loading the image by TMemoryStream
?