Exemple #1
0
        //u have to do this too
        private void _OnOpenClick(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = @"C:\Documents and Settings\my documents\my pictures";
            openFileDialog1.Title            = "Select a File";
            openFileDialog1.Filter           = "Image Files|*.bmp;*.jpg; *.jpeg;*.png; *.gif; *.tif";
            openFileDialog1.FilterIndex      = 1;
            if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
            {
                picToDisplay = @openFileDialog1.FileName;
                CreateTabPicture(new ImageShower.Picture(picToDisplay).GetEnumerator());
                tabArray.Add(picture = new ImageShower.Picture(picToDisplay));

                Console.WriteLine(currentTab);
                //newPicEnum = ((ImageShower.Picture)tabArray[currentTab]).GetEnumerator();
                this.DisplayPics( );
                Text = "Pict0 Vi3w3r! - " + picToDisplay;
                this.menuItemClone.Enabled = true;

                //runThis.Start();
            }
            else
            {
                picToDisplay = "";
            }
        }
                private void _OnDragDrop(object sender, DragEventArgs e)
                {
                    try
                    {
                        this.pictureBox.BackColor = Color.DarkGray;

                        if (!e.Data.GetDataPresent(DataFormats.FileDrop))
                        {
                            e.Effect = DragDropEffects.None;
                            return;
                        }
                        e.Effect = DragDropEffects.All;
                        ImageShower.ViewGui.picToDisplay = (System.String)((System.Array)e.Data.GetData(
                                                                               DataFormats.FileDrop)).GetValue(0);

                        ImageShower.Picture picture = new ImageShower.Picture(picToDisplay);
                        //newPicEnum = picture.GetEnumerator();
                        //DisplayPics( );
                        this.Invalidate();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message.ToString(), "ERROR!");
                    }
                }