Page 1 of 1

Anti-alias in realtime graph

Posted: Tue Nov 11, 2003 11:03 pm
by 8577319
How do we use anti alias in a real time graph? How can we add the point with anti alias applied?

Thanks.

Posted: Fri Nov 14, 2003 2:49 pm
by Pep
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