/// <summary> /// Draws a line between two points on the bitmap /// </summary> /// <param name="canvas"></param> /// <param name="color"></param> /// <param name="startPoint"></param> /// <param name="endPoint"></param> public static void DrawLine(Bitmap canvas, Color color, PointFT startPoint, PointFT endPoint) { using (var g = Graphics.FromImage(canvas)) { var pen = new Pen(color, 2); g.DrawLine(pen, startPoint.ToScreenAbsolute().X, startPoint.ToScreenAbsolute().Y, endPoint.ToScreenAbsolute().X, endPoint.ToScreenAbsolute().Y); } }
/// <summary> /// Draws a Point on the canvas /// </summary> /// <param name="canvas"></param> /// <param name="color"></param> /// <param name="point"></param> public static void DrawPoint(Bitmap canvas, Color color, PointFT point) { using (var g = Graphics.FromImage(canvas)) { var pen = new Pen(color, 2); g.DrawEllipse(pen, point.ToScreenAbsolute().X, point.ToScreenAbsolute().Y, 3, 3); } }
public Line(PointFT start, PointFT end) { Start = start.ToScreenAbsolute(); End = end.ToScreenAbsolute(); }