|
-
Jun 27th, 2006, 09:40 AM
#1
Thread Starter
Hyperactive Member
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
-
Jun 27th, 2006, 04:19 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|