**jany_ wrote:**
I used this code but it returns (0,0,0) for both points..Where is my mistake?Can you please help me?
Thanks
You have to use pixel coordiates for g.DrawLine.Hi,
In your example you'd simply usebecause that are the pixel coordinates that correspond to the geographic cooordinates (ptfpr1, ptfpr2) you wanted to use for drawing.g.DrawLine(bluePen, ptf1, ptf2);
I used this code but it returns (0,0,0) for both points..Where is my mistake?Can you please help me?
Thanks
System.Drawing.Point ptf1 = new System.Drawing.Point(0, 0);
System.Drawing.Point ptf2 = new System.Drawing.Point(300,400);
DotSpatial.Topology.Coordinate ptfpr1 = new DotSpatial.Topology.Coordinate(map1.PixelToProj(ptf1));
DotSpatial.Topology.Coordinate ptfpr2 = new DotSpatial.Topology.Coordinate(map1.PixelToProj(ptf2));
g.DrawLine(drawingPen, ptf1, ptf2);