How do we use anti alias in a real time graph? How can we add the point with anti alias applied?
Thanks.
Anti-alias in realtime graph
-
- Newbie
- Posts: 6
- Joined: Fri Oct 10, 2003 4:00 am
- Location: new zealand
- Contact:
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
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