DGL-luke zeigt
hier, wie man den Inhalt von TGraphic als Bitmap erhält.
Delphi-Quellcode:
procedure GetBitmap(const Graphic: TGraphic; out Bitmap: TBitmap);
begin
if Bitmap = nil then
Bitmap := TBitmap.Create;
Bitmap.SetSize(Graphic.Width,Graphic.Height);
Bitmap.Canvas.Draw(0,0,Graphic);
end;
In manchen Fällen funktioniert die folgende Lösung nämlich nicht immer:
Delphi-Quellcode:
procedure GraphicToBitmap(const g: TGraphic; out bmp: TBitmap);
begin
bmp.Assign(g);
end;