Export TChart to GIF with TChart V7 / Delphi 2006

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Pie Percent
Newbie
Newbie
Posts: 2
Joined: Tue Mar 16, 2004 5:00 am

Export TChart to GIF with TChart V7 / Delphi 2006

Post by Pie Percent » Mon Jan 02, 2006 10:13 pm

I update TChart 7 for Delphi 2006 (VCL for Win 32).

My export to GIF done a black image.
Before this update, the image was good.

With TGIFExportFormat.Create do
try
Panel := Chart1;
SaveToFile("C:\file1.gif");
finally
Free;
end;

Thanks for your help,

Franck, :wink:

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Jan 03, 2006 10:09 am

Hi Franck,

using the following code should work fine :

Code: Select all

procedure TForm1.BitBtn1Click(Sender: TObject);
var gif:TGIFImage;
    tmpBitmap : TBitmap;
begin
  gif := TGifImage.Create;
  tmpBitmap:=Chart1.TeeCreateBitmap(clWhite,Rect(0,0,Chart1.Width,Chart1.Height));
  try
    gif.Assign(tmpBitmap);
    gif.SaveToFile('c:\Chart.gif');
  finally
    tmpBitmap.Free;
  end;
end;

Post Reply