I let user to draw on a form. I start when my app get the mouse down even. I end when it gets the mouse up event. I draw on mousemove event.
I.E in mouse down event i get the StartPoint. Then in mousemove i check, if mouse is still down then i draw according to the mouse position. I draw using DrawLine function. I save the previous point and draw to the new point i get in mousemove. lets say mouse moved from P1(x1,y1),P2(x2,y2),P3(x3,y3) then i have line from P1 to P2 to P3. Everything works as it should. Problem starts when i draw with transparent color (i.e Alpha is 100 for example). When i do that, P2 get painted twice. first time when line is drawn from p1 to p2 and second time when line drawn from p2 to p3.
When Alpha is 255 you do not see it since p2 color will not change when you over write it. It stays the pen color. When you overwrite with alpha that is not equal to 255 then on each overwrite the color become darker with looks as small dots inside the line.
I have attached screenshot so you will see the problem: http://ift.tt/1DjLAet Any solution to make lines with no dot in it? do not forget that there can be many points in the line and it is free drawing so line is not Straight. Each dot you see in the line was created on each call to mousemove.
Aucun commentaire:
Enregistrer un commentaire