Hi,
I would like to preload 10-20 photos (200kB or so each) when the program starts so that I can randomly show them quicker later.
Please show me how to display them in picturebox, command button or maybe draw them on a form side by side. I need to be able to switch the pictures or move them around with a press of a button.
Tried the following code to load them, but don't know how to display them. Also let me know if there's a better way of doing this.
Code:ImageList pics = new System.Windows.Forms.ImageList(); private void button1_Click(object sender, System.EventArgs e) { // Get all the picture files in the current directory. string[] picFiles = Directory.GetFiles(Application.StartupPath, "*.jpg"); // Create an Image object for each file and add it to the ImageList. foreach (string pic in picFiles) { Bitmap newB = new Bitmap(pic); pics.Images.Add(newB); } }




Reply With Quote