PolygonFloat...world or screen coordinates?
PolygonFloat...world or screen coordinates?
I don't know why I cannot find any documentation or previous posts about this, but do the xxFloat calls take world or screen coordinates? I tried sending world figuring that was the purpose and the points would be transformed to screen in the call, but it does not seem to be working.
Re: PolygonFloat...world or screen coordinates?
Hello,
All the drawing methods in the canvas use screen coordinates.
Here you have an example using
All the drawing methods in the canvas use screen coordinates.
Here you have an example using
PolygonFloat
function:Code: Select all
uses Chart, TeEngine, TeCanvas, Series;
var Chart1: TChart;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1:=TChart.Create(Self);
with Chart1 do
begin
Parent:=Self;
Align:=alClient;
Color:=clWhite;
Gradient.Visible:=False;
Walls.Back.Color:=clWhite;
Walls.Back.Gradient.Visible:=False;
Legend.Hide;
View3D:=False;
AddSeries(TPointSeries).FillSampleValues;
OnAfterDraw:=ChartAfterDraw;
end;
end;
procedure TForm1.ChartAfterDraw(Sender: TObject);
var
series: TChartSeries;
polygon: Array of TPointFloat;
tmpBlend : TTeeBlend;
i: Integer;
begin
if Chart1.SeriesCount<1 then
Exit;
series:=Chart1[0];
if series.Count<2 then
Exit;
SetLength(polygon, series.Count+2);
for i:=0 to series.Count-1 do
begin
polygon[i].x:=series.CalcXPos(i);
polygon[i].y:=series.CalcYPos(i);
end;
polygon[i].x:=polygon[i-1].x;
polygon[i].y:=Chart1.Axes.Bottom.PosAxis;
Inc(i);
polygon[i].x:=polygon[0].x;
polygon[i].y:=polygon[i-1].y;
tmpBlend:=Chart1.Canvas.BeginBlending(Chart1.ChartRect, 50);
Chart1.Canvas.Pen.Style:=psDash;
Chart1.Canvas.Brush.Color:=clRed;
Chart1.Canvas.PolygonFloat(polygon);
Chart1.Canvas.EndBlending(tmpBlend);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |