Пример #1
0
        //*************************
        // Load Images from disk
        //*************************
        private void button1_Click(object sender, EventArgs e)
        {
            openFileDialog2.Multiselect = true;
            openFileDialog2.Filter      = "JPEG Images|*.jpg;*.JPG";

            this.Cursor = Cursors.WaitCursor;
            if (openFileDialog2.ShowDialog() == DialogResult.OK)
            {
                if (openFileDialog2.FileNames != null)
                {
                    FileInfo startfile = new FileInfo(openFileDialog2.FileNames.First());
                    FileInfo endfile   = new FileInfo(openFileDialog2.FileNames.Last());

                    ImagesLeft  = openFileDialog2.FileNames.Count();
                    label4.Text = ImagesLeft + " images loaded";
                    textBox1.AppendText("Loading Files " + startfile.Name + " to " + endfile.Name + "\r\n");
                    textBox1.AppendText(ImagesLeft + " total files\r\n");

                    for (int i = 0; i < openFileDialog2.FileNames.Length; i++)
                    {
                        ImageClass newImage = new ImageClass(openFileDialog2.FileNames[i]);
                        ImageList.Add(newImage);
                        //picBox1.Add(new PictureBox());
                        //picBox1[i].Image = ImageList[i].GetThumbnail(ImageList[i].FileName);
                        //picBox1[i].Location = new System.Drawing.Point(12, (100 * i) + (i * 10) + 10);
                        //picBox1[i].Name = i.ToString();
                        //picBox1[i].Size = new System.Drawing.Size(picBox1[i].Image.Width, picBox1[i].Image.Height);
                        //panel1.Controls.Add(picBox1[i]);
                    }
                }
                textBox1.AppendText("Done Loading.\r\n\r\n");
            }
            this.Cursor = Cursors.Default;
        }
Пример #2
0
        //*************************
        // Load Images from disk
        //*************************
        private void button1_Click(object sender, EventArgs e)
        {
            openFileDialog2.Multiselect = true;
            openFileDialog2.Filter      = "JPEG Images|*.jpg;*.JPG";

            this.Cursor = Cursors.WaitCursor;
            if (openFileDialog2.ShowDialog() == DialogResult.OK)
            {
                if (openFileDialog2.FileNames != null)
                {
                    FileInfo startfile = new FileInfo(openFileDialog2.FileNames.First());
                    FileInfo endfile   = new FileInfo(openFileDialog2.FileNames.Last());

                    ImagesLeft  = openFileDialog2.FileNames.Count();
                    label4.Text = "Loading Images...";
                    label4.Refresh();

                    textBox1.AppendText("Loading " + ImagesLeft + " Total Files: \r\n" + startfile.Name + " to " + endfile.Name + "\r\n");
                    Cursor.Current = Cursors.WaitCursor;

                    for (int i = 0; i < openFileDialog2.FileNames.Length; i++)
                    {
                        ImageClass newImage = new ImageClass(openFileDialog2.FileNames[i]);
                        ImageList.Add(newImage);
                    }
                }
                label4.Text = ImagesLeft + " images loaded";
                textBox1.AppendText("Done Loading.\r\n\r\n");
                Cursor.Current = Cursors.Default;
            }
            this.Cursor = Cursors.Default;
        }