private void pictureBox4_Click(object sender, EventArgs e)
        {
            if (images.Count > 0)
            {
                --currentImageItem;
                if (currentImageItem == -1)
                {
                    currentImageItem = images.Count - 1;
                }

                Image    image;
                string[] info;
                DecodingProgram.DecodeImage(out image, out info, images[currentImageItem]);
                DisplayImage(image, info);
            }
        }
 private void panel_DragDrop(object sender, DragEventArgs e)
 {
     string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false);
     foreach (string file in files)
     {
         Image    image;
         string[] info;
         DecodingProgram.DecodeImage(out image, out info, file);
         if (image != null)
         {
             DisplayImage(image, info);
             SetCurrentDirectory(file.Substring(0, file.LastIndexOf('\\')));
             while (images[currentImageItem].Equals(file) == false)
             {
                 ++currentImageItem;
             }
         }
     }
 }
        private void btnOpen_Click(object sender, EventArgs e)
        {
            var dialog = new OpenFileDialog();

            dialog.Filter  = "Protected Images|*.pff";
            dialog.FileOk +=
                new CancelEventHandler((object s, CancelEventArgs cea) =>
            {
                Image image;
                string[] info;
                DecodingProgram.DecodeImage(out image, out info, dialog.FileName);
                if (image != null)
                {
                    DisplayImage(image, info);
                    SetCurrentDirectory(dialog.FileName.Substring(0, dialog.FileName.LastIndexOf('\\')));
                    while (images[currentImageItem].Equals(dialog.FileName) == false)
                    {
                        ++currentImageItem;
                    }
                }
            });
            dialog.ShowDialog(this);
        }