Results 1 to 4 of 4

Thread: drawing in a picture box

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2000
    Posts
    27
    i am trying to learn how to make a small paint program and would like to know how to draw lines in a picture box. I know how to draw lines on the form, just not the picture box

  2. #2
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208
    hum....
    try whit the Get/Set pixel..
    I can't help you because I dont know how to use it ..
    But I sure that you can whit thoses commands. .

  3. #3
    Lively Member Feras's Avatar
    Join Date
    Sep 2000
    Location
    Homs, Syria
    Posts
    85
    You can use the same function that used on a form:

    Picture1.Line (x1, y1)-(x2, y2), RGB(200, 10, 10)

    is that what you want?
    Yesterday is history ... Tomorrow is mistry .. Today is a gift.

    VB6 , intermidiat

  4. #4
    Guest
    Try this:

    Code:
    Public A, B As Integer
    
    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then Picture1.Line (A, B)-(X, Y)
        A = X: B = Y
    End Sub
    
    
    Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then Picture1.Line (X, Y)-(X + 15, Y + 15)
    End Sub

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