Anti-alias in realtime graph

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ChainSmokinCodeWriter
Newbie
Newbie
Posts: 6
Joined: Fri Oct 10, 2003 4:00 am
Location: new zealand
Contact:

Anti-alias in realtime graph

Post by ChainSmokinCodeWriter » Tue Nov 11, 2003 11:03 pm

How do we use anti alias in a real time graph? How can we add the point with anti alias applied?

Thanks.

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

Post by Pep » Fri Nov 14, 2003 2:49 pm

Hi Gusmoko,

you can use the Antialias method as in the following example :
implementation
uses TeCanvas;
{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(1000);
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
Chart1.Invalidate;
end;

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var b: TBitmap;
begin
if CheckBox1.Checked and (not InsideAntiAliasing) then
begin
InsideAntiAliasing:=True; // set flag to avoid re-entrancy
try
b:=TeeAntiAlias(Chart1); // create anti-aliased bitmap
try
Chart1.Canvas.Draw(0,0,b); // draw bitmap onto Chart1
finally
b.Free; // delete temporary bitmap
end;
finally
InsideAntiAliasing:=False; // reset flag
end;
end;
end;

end.

Best Regards
Josep Lluis Jorge
pep@steema.com

Post Reply