Results 1 to 3 of 3

Thread: hmm having trouble... (Picturebox, ImageList)

  1. #1

    Thread Starter
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    hmm having trouble... (Picturebox, ImageList)

    VB Code:
    1. Private Sub Command1_Click()
    2.     Picture1.Circle (1000, 500), 250, 10
    3.     Picture1.Line (1000, 750)-(1000, 2000), 10  'body
    4.     Picture1.Line (1000, 1100)-(450, 900), 10  'left arm
    5.     Picture1.Line (1000, 1100)-(1550, 900), 10 'right arm
    6.     Picture1.Line (1000, 2000)-(450, 2700), 10  'left leg
    7.     Picture1.Line (1000, 2000)-(1550, 2700), 10  'right leg
    8.     Form1.ImageList1.ListImages.Add 1, , Picture1.Image
    9. End Sub
    10.  
    11. Private Sub Command2_Click()
    12.     Picture1.Cls
    13. End Sub
    14. Private Sub Command3_Click()
    15.     Picture1.Picture = ImageList1.ListImages(1).Picture
    16.     Picture1.Refresh
    17. End Sub


    Basically I'm trying to come up with a way to write sprites using pictures in a picturebox made using code.

    how ever I can't get the picture in the picturebox to load into imagelist, then loaded back into the picturebox after clearing the picture box...any ideas?
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    There's nothing wrong with your code, however the Image property of a PictureBox is always empty unless you've set the AutoRedraw property to True. So you've probably forgot to do so.

  3. #3

    Thread Starter
    Fanatic Member TokersBall_CDXX's Avatar
    Join Date
    Mar 2003
    Location
    America
    Posts
    571

    :cool:

    Thanx!
    Build your own personalized flash based chat room for your webpage for FREE! http://www.4computerheaven.com

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