I am trying to write a form which the user can draw on by holding down and moving the mouse. Therefore I am subscribing to the MouseMove event and using the Point given to draw a Pixel at that point.
Unfortunately, the faster I move the mouse, the more points are skipped and discarded by the message queue, so instead of me ending up with a line drawn by a pen, I end up with a series of points.
Do I need to manually fill in the blanks between each point? And if so, what is a good algorithm to calculate a list of the points between two points.
You could just save the points as line segments while the user draws and display those using Graphics.DrawLine. If you do want the actual points, you’ll have to decide on whether you want straight lines or interpolate arcs (rounded) through them.
For straight lines there’s http://en.wikipedia.org/wiki/Bresenham's_line_algorithm – arcs are a little bit more complicated 🙂