Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

load multiple picture box in panel

triskelixtriskelix Posts: 1Member
hi, I need to load multiple image in a window, the problem is when I'm loading so many images, lets say about 500 or more images it throws out of memory exception, another problem is the height property of the control is only limited to about 32,000, when I try to add many pictureBox it does not fit in the panel control and some pictureBox are not display, here's my codes ..
[code]

private void Form1_Load(object sender, EventArgs e)
{
string imageDirectory = @"c: empmyImages";

string[] imageFileList = Directory.GetFiles(imageDirectory);

int iCtr = 0;
foreach (string imageFile in imageFileList)
{
PictureBox eachPictureBox = new PictureBox();
eachPictureBox.Size = new Size(850, 1100);
eachPictureBox.Location = new Point(1, iCtr * 1100 + 1);
eachPictureBox.Image = Image.FromFile(imageFile);
iCtr++;

panel1.Controls.Add(eachPictureBox);

}

}
[/code]

I try to load it when the window form loads, any tips will be much appreciated, thanks ..
Sign In or Register to comment.