Zur besseren Wiederverwendbarkeit der TGPImages aus TGraphics habe ich eine kleine Wrapperklasse geschrieben, wer's brauchen kann...
Delphi-Quellcode:
Type TGPImageWrapper=Class(TObject)
private
FImage: TGPImage;
FStream: TMemoryStream;
public
Constructor Create(AGraphic:TGraphic);
Destructor Destroy;override;
Public
Property Image:TGPImage read FImage;
End;
________
{ TGPImageWrapper }
constructor TGPImageWrapper.Create(AGraphic: TGraphic);
begin
FStream := TMemoryStream.Create;
AGraphic.SaveToStream(FStream);
Fimage:= TGPImage.Create(TStreamAdapter.Create(FStream));
end;
destructor TGPImageWrapper.Destroy;
begin
FImage.Free;
FStream.Free;
inherited;
end;