Results 1 to 5 of 5

Thread: Draw in a PictureBox

  1. #1

    Thread Starter
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642

    Draw in a PictureBox

    How can i draw these lines in a picture box?
    Attached Images Attached Images  
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    hi eimroda

    you can do something like this



    VB Code:
    1. Private Sub Form_Load()
    2.     Dim i As Integer
    3.     Dim iHeight As Integer
    4.     iHeight = 500
    5.     Picture1.BackColor = vbWhite
    6.     Picture1.AutoRedraw = True
    7.     For i = 0 To 4
    8.         Picture1.Line (0, iHeight * i)-(Picture1.ScaleWidth, iHeight + (iHeight * i)), vbBlack, B
    9.     Next i
    10. End Sub
    -= a peet post =-

  3. #3

    Thread Starter
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642
    thnx peet! How about the vertical lines?
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    They are there but too close to the edge of the picturebox.
    -= a peet post =-

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    try this

    VB Code:
    1. Private Sub Form_Load()
    2.     Dim i As Integer
    3.     Dim iHeight As Integer
    4.     iHeight = 500
    5.     Picture1.BackColor = vbWhite
    6.     Picture1.AutoRedraw = True
    7.     For i = 0 To 4
    8.         Picture1.Line (100, iHeight * i)-(Picture1.ScaleWidth - 100, iHeight + (iHeight * i)), vbBlack, B
    9.     Next i
    10. End Sub
    -= a peet post =-

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