XE3 and GIF files
Posted: Tue Jan 15, 2013 10:33 pm
in Delphi 6 I could save Tchat to GIF file with
procedure TForm1.Button1Click(Sender: TObject);
var tmpGIF : TGIFImage;
begin
tmpGIF:=TGIFImage.Create;
With tmpGIF do
begin
Compression:=gcLZW;
DitherMode:=dmStucki;
ColorReduction:=rmQuantizeWindows;
Assign(Chart1.TeeCreateBitmap(Chart1.Color,Rect(0,0,Chart1.Width,Chart1.Height)));
SaveToFile('c:\tempCharts\Chart1.gif');
end;
end;
But in XE3 I cannot use the old Anders Melanders gifunit, I understand gif is now part of
vcl.imaging.gifimg unit
Is there a recommended way to get Tchart imge out to a gif file with xe3?
I tried
var
tmpimage:timage;
.
tmpimage.Assign(Chart1.TeeCreateBitmap(Chart1.Color,Rect(0,0,Chart1.Width,Chart1.Height)));
and I tried
tmpimage.picture.Assign(Chart1.TeeCreateBitmap(Chart1.Color,Rect(0,0,Chart1.Width,Chart1.Height)));
both bomb at runtime with cannot assign a Tbitmap to a Timage. Any help appreciated.
thanks
Sean
procedure TForm1.Button1Click(Sender: TObject);
var tmpGIF : TGIFImage;
begin
tmpGIF:=TGIFImage.Create;
With tmpGIF do
begin
Compression:=gcLZW;
DitherMode:=dmStucki;
ColorReduction:=rmQuantizeWindows;
Assign(Chart1.TeeCreateBitmap(Chart1.Color,Rect(0,0,Chart1.Width,Chart1.Height)));
SaveToFile('c:\tempCharts\Chart1.gif');
end;
end;
But in XE3 I cannot use the old Anders Melanders gifunit, I understand gif is now part of
vcl.imaging.gifimg unit
Is there a recommended way to get Tchart imge out to a gif file with xe3?
I tried
var
tmpimage:timage;
.
tmpimage.Assign(Chart1.TeeCreateBitmap(Chart1.Color,Rect(0,0,Chart1.Width,Chart1.Height)));
and I tried
tmpimage.picture.Assign(Chart1.TeeCreateBitmap(Chart1.Color,Rect(0,0,Chart1.Width,Chart1.Height)));
both bomb at runtime with cannot assign a Tbitmap to a Timage. Any help appreciated.
thanks
Sean