Results 1 to 10 of 10

Thread: Drawing program

Threaded View

  1. #6
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    ok......

    use 2 pictureboxes
    set picture1 and picture2's autoredraw to true
    set picture2's visible to false

    insert code:

    Dim X1 As Long, Y1 As Long
    Dim DrawNow As Boolean

    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DrawNow = True
    X1 = X
    Y1 = Y
    End Sub

    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If DrawNow = True Then
    Picture1.Cls
    Picture1.Line (X1, Y1)-(X, Y)
    End If
    End Sub

    Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DrawNow = False
    Picture2.Picture = Picture1.Image
    Picture1.Picture = Picture2.Picture
    End Sub
    Last edited by cyborg; Sep 20th, 2001 at 08:58 AM.
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

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