Пример #1
0
        private void UpdatePicBox()
        {
            UpdateLabel();
            var link = this.linkList[this.index];

            PictureBox1.Load(link);
        }
 private void Button1_Click(System.Object sender, System.EventArgs e)
 {
     {
         var withBlock = OpenFileDialog1;
         withBlock.Title       = "Select a image";
         withBlock.FileName    = "";
         withBlock.Multiselect = false;
         withBlock.Filter      = "Images Files| *.png; *.jpg; *.jpeg; *.bmp; *.gif;";
         withBlock.ShowDialog();
         if (withBlock.FileName != "")
         {
             PictureBox1.Load(Utils.SaveImageToApplicationFolder(withBlock.FileName));
         }
     }
 }
Пример #3
0
 private void bnload_Click(System.Object sender, System.EventArgs e)
 {
     {
         var withBlock = OpenFileDialog1;
         withBlock.Title       = "Select a Jpeg photo";
         withBlock.FileName    = "";
         withBlock.Multiselect = false;
         withBlock.Filter      = "Images Files| *.png; *.jpg; *.jpeg; *.bmp; *.gif;";
         withBlock.ShowDialog();
         if (withBlock.FileName == "")
         {
             return;
         }
         else
         {
             try { PictureBox1.Load(Utils.SaveImageToApplicationFolder(withBlock.FileName)); } catch (Exception ex) { MessageBox.Show("Please select an image", "Invalid file", MessageBoxButtons.OK, MessageBoxIcon.Error); }
         }
     }
 }