That's pretty simple to start with: the mouse capture stuff is trivial.
Add a Panel to a form - call it "myDrawing" - and handle two events for the Panel: Paint, and MouseClick.
Add a list to your form class:
private List<Point> points = new List<Point>();
Now, in the MouseClick handler, add the location to the list and invalidate the panel:
private void myDrawing_MouseClick(object sender, MouseEventArgs e)
{
points.Add(e.Location);
myDrawing.Invalidate();
}
In the Paint handler, draw the points:
private void myDrawing_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
foreach (Point p in points)
{
g.FillEllipse(Brushes.Red, new Rectangle(p.X - 2, p.Y - 2, 4, 4));
}
}
Gridding the field isn't difficult (it's just a case of "rounding up" the location before you save it and drawing faint lines in the Paint event if you need them)
That should give you a start - to draw the Bezier is the complicated bit, but Wiki should help:
Bézier curve - Wikipedia, the free encyclopedia[
^]
Don't expect this to work first time, and don't expect it to be easy - implementing Bezier is not a trivial exercise!
Have a look at the
Graphics class[
^] and you see it has a DrawPath method whihc may be of use to you in drawing the actual curve.
Good luck!