Example #1
0
 private void PictureBox_Click(object sender, EventArgs e)
 {
     if (sender is PictureBox)
     {
         Form_PreviewPic form_PreviewPic = new Form_PreviewPic(((PictureBox)sender).Image, ((PictureBox)sender).Tag.ToString());
         form_PreviewPic.ShowDialog();
     }
 }
Example #2
0
        private void OnChangedPic(PictureBox pictureBox, string path)
        {
            if (pictureBox.InvokeRequired)
            {
                pictureBox.BeginInvoke(new dgOnChangedPic(OnChangedPic), new object[] { pictureBox, path });
            }
            else
            {
                try
                {
                    pictureBox.Image = Image.FromFile(path);
                    pictureBox.Tag   = path;
                }
                catch (Exception)
                {
                }

                new System.Threading.Thread(new System.Threading.ThreadStart(ThreadRefreshCamera)).Start();

                Form_PreviewPic form_PreviewPic = new Form_PreviewPic(pictureBox.Image, path);
                form_PreviewPic.ShowDialog();
            }
        }