PDA

Click to See Complete Forum and Search --> : Custom Brush


HCK
Feb 13th, 2001, 05:03 PM
I want to use a custom bush for my calligraphy programme. It's no problem to paint with this brush. I just use BitBlt while the mouse button is pressed.
But when I move the mouse a little more faster I won't get a line of course. It's also no problem to remember the last point and draw a line between the last and the current point but that makes no sense when using a custom brush.

Is there any possiblity to solve this problem? I'm feeling so bad when I look at the calligraphy brush in Adobe Illustrator because this is excactly what I want. How do they do that?

Arcom
Feb 13th, 2001, 05:19 PM
Try this:

Dim lX As Long, lY As Long ' new starting coordinates

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If the left MB is clicked, set up new coordinates
If (Button And vbLeftButton) = vbLeftButton Then
lX = X
lY = Y
End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' If the left MB is pressed, draw a line from lX, lY to X, Y and set new starting coordinates
If (Button And vbLeftButton) = vbLeftButton Then
Line (lX, lY)-(X, Y)
lX = X
lY = Y
End If
End Sub

HCK
Feb 14th, 2001, 02:57 PM
Thanks, but I already know that. That only makes sense when using PSet to draw. But I have my own brush, it has the form of a crooked circle, like a pen-nib. So I can't just use The line method.