Пример #1
0
        protected Bitmap GetCapture()
        {
            Bitmap img = null;


            if (CallerControl != null)
            {
                if (CallerControl.InvokeRequired)
                {
                    CallerControl.Invoke(new Action(() => img = Camera.AcquireImage()));
                }
                else
                {
                    img = Camera.AcquireImage();
                }
            }
            return(img);
        }
Пример #2
0
        string ShowDialog()
        {
            DialogResult   result = DialogResult.Ignore;
            SaveFileDialog dlg    = new SaveFileDialog();

            dlg.Filter           = DialogFilter;
            dlg.InitialDirectory = Program.UserDataPath;
            dlg.CheckFileExists  = false;
            if (CallerControl != null)
            {
                CallerControl.Invoke(new Action(() => result = dlg.ShowDialog()));
            }
            else
            {
                result = dlg.ShowDialog();
            }
            if (result == DialogResult.OK)
            {
                return(dlg.FileName);
            }
            return(string.Empty);
        }