I'm not sure what the exact question is that's being asked here. You have no Delphi TPoint
in your code snippet; you simply have client rect logical coordinates.
The origin is at X = 0, Y = 0
, which is the top left corner of the client area. Increasing X
moves the position to the right, and increasing Y
moves the position down. Logical units are pixels, so starting at the origin of 0, 0
, a Canvas.MoveTo(10, 10)
would set the new drawing position in from the left edge 10 pixels and down from the top 10 pixels, and a Canvas.LineTo(20, 20)
from there would draw a line from the point at 10, 10
to 20, 20
.
TCanvas.MoveTo
and TCanvas.LineTo
are simply wrappers around the underlying Windows GDI functions MoveToEx
(with an always NULL
third parameter) and LineTo
.
As far as the C# equivalent, if you're referring to System.Drawing.Point
, the units used are exactly the same (although I'm not sure where the origin is based by default). Given an origin of 0, 0
, System.Drawing.Point(10, 10)
should be the same position described above - 10 pixels from the left edge and 10 pixels down from the top edge.
A quick check confirms that the origin in a WinForms application is in fact the top left corner of the client area, using:
// Delphi code
procedure TForm3.FormPaint(Sender: TObject);
begin
Canvas.Pen.Color := clRed;
Canvas.MoveTo(0, 0);
Canvas.LineTo(100, 100);
end;
// C# code
private void Form1_Paint(object sender, PaintEventArgs e)
{
Pen newPen = new System.Drawing.Pen(Color.Red);
e.Graphics.DrawLine(newPen, new Point(0, 0), new Point(100, 100));
}
This produces the following output: