Results 1 to 3 of 3

Thread: Custom Brush

  1. #1

    Thread Starter
    New Member HCK's Avatar
    Join Date
    Feb 2001
    Location
    Germany
    Posts
    5

    Question

    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?

  2. #2
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    Try this:

    Code:
    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

  3. #3

    Thread Starter
    New Member HCK's Avatar
    Join Date
    Feb 2001
    Location
    Germany
    Posts
    5
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width