Results 1 to 2 of 2

Thread: Load pictures at runtime

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Ont, Canada, Earth
    Posts
    458

    Load pictures at runtime

    Hi,
    I'm trying to load some pictures in the Form_Load() at run time.
    The paths to the pictures are stored in a text file.
    I assume that the pictures will be loaded into ImageList? control,
    and displayed in a picture control when needed.

    I've never used imagelist so I'm not sure how to go about that.

    1) How do I load the pics into ImageList at runtime
    2) How do I access the pics from ImageList and shop in a pictureBox
    Thanks

    Tomexx.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Load pictures at runtime

    This is how you do it in 2003, I'm pretty sure it's the same in 2005
    Code:
    ImageList il=new ImageList();
    il.Images.Add(Image.FromFile(@"ImagePath"));
    //Do it for all images
    PictureBox pb=new PictureBox();
    pb.Image=il.Images[0];
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

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