Das neue Bing sagt u.a. das hier:
Delphi-Quellcode:
procedure SaveDirect2DCanvasAsPNG(const FileName: string; const Canvas: TDirect2DCanvas);
var
png: TPngImage;
begin
png := TPngImage.CreateBlank(COLOR_RGBALPHA, 8,
Canvas.RenderTarget.Size.Width,.
Canvas.RenderTarget.Size.Height);
try
Canvas.RenderTarget.GetPixelData(PixelFormat32bppPBGRA,
png.Scanline[0], png.Height * png.BytesPerScanline);
png.SaveToFile(FileName);
finally
png.Free;
end;
end;