Timed Painting

daspope

New member
Joined
Aug 2, 2004
Messages
4
Hello all, i did a search about paint apps where people were having problems with breaks in the line when they move the mouse too fast...

some people responded saying that a timer.tick event containing the drawing procedure should help. but that infact made the problem much much worse in my case, i even set the interval to 1 and its still worse than without the timer.

any ideas?
 
I dont see how you are going to fix that... that is a problem on even the most advanced programs... the mousemove event simply will not be registered for each tiny increment of the mouse... even if you move the mouse, youll see it kind of jump to different spots on the form. If you think that its something else, then how are you drawing the lines and in what procedure?
 
heres an example how im drawing.
Code:
in my mouseup/down event.
        If canpaint = True Then
            If tool = 1 Then
                drawbr(e.X, e.Y)
            End If
        End If

drawbr is big due to all the brushes so far so i will post how 1 brush gets drawn.

Dim g As Graphics = PictureBox1.CreateGraphics
.
.
.
If brush = 11 Then
            g.FillEllipse(New SolidBrush(Label1.BackColor), x, y, HScrollBar1.Value, HScrollBar1.Value)
        End If
.
.
.

i did provide a small work arround for plain brushes, but it doesnt work on complex brushes as the attachment will show.

its where i create a pen object from my brush object, works fine for solid brushes and what not, but when it comes to more complex gradient brushes it goes to crap...

the brushing on the left is from my brush and you will see how it "breaks up" at the bottom.

and then you will see the pen on the right, which just looks like a crappy alternative.
 
Back
Top