views:

1022

answers:

2
+3  A: 

One little tip... on your mousemove event. keep a flag that wont fire the event again until the last event that set the flag turns it off. i.e.:

bool isDrawing = false;
public void myCanvas_MouseMove(object sender, EventArgs e)
{
     if(!isDrawing)
     {
         isDrawing = true;
         // Do drawing here
         isDrawing = false;
     }
}

This helped me a lot when doing drawing in a mousemove event.

Neil N
I think that just might do it. It's basically a lock, I reckon?
Nefzen
Tried it, it doesn't make much of a difference.
Nefzen
The next time I added was a delay... Not letting the draw event fire unless its been at least 5 milliseconds since the last one fired.. or 3ms.. depending on your draw method. This halps smooth out the drawing.
Neil N
^the next "thing" I adeed was a delay...^
Neil N
A: 

Dots: (x,y),(x2,y2),(x3,y3)

Lines: (x,y,x2,y2),(x3,y3,x4,y4)

Thus, the format is a list of tuples. Tuples of size 4 are lines, of size 2 are points. Note that if your system gets more complicated, you'll really regret not just doing something like:

Dots: D(x,y),D(x2,y2),D(x3,y3)

Lines: L(x,y,x2,y2),L(x3,y3,x4,y4)

Brian