Beispiel #1
0
        private void BeginToSnapShot()
        {
            using (FrmShotSnap fss = new FrmShotSnap())
            {
                if (fss.ShowDialog() == DialogResult.OK)
                {
                    var img = fss.GetSnappedImage();
                    LogFile.Log(this, new { }, "img is null?" + (img == null).ToString(), null, enLogLevel.Low);

                    if (IsSnapToEdit)
                    {
                        var ImageEditForm = new frmImageEdit(this, img);
                        ImageEditForm.Show();
                    }
                    else
                    {
                        SaveImage(img);
                    }
                }
            }
        }
 private void BeginToSnapShot()
 {
     using (FrmShotSnap fss = new FrmShotSnap())
     {
         if (fss.ShowDialog() == DialogResult.OK)
         {
             var img = fss.GetSnappedImage();
             LogFile.Log(this, new { }, "img is null?" + (img == null).ToString(), null, enLogLevel.Low);
             if (!spm.IsFileSave)
             {
                 try
                 {
                     //Clipboard.SetImage(img);
                     Clipboard.SetDataObject(img, true);
                 }
                 catch (Exception ex)
                 {
                     LogFile.Log(this, new { Width = img.Width, Height = img.Height }, string.Format("{0}/{1}/{2}", this.GetType().ToString(), img.Width, img.Height), ex, enLogLevel.High);
                 }
             }
             else
             {
                 if (!spm.FSavePam.IsAutoSave)
                 {
                     SaveFileDialog sfd = new SaveFileDialog();
                     sfd.Filter = "*.Png|*.Png";
                     if (sfd.ShowDialog() == DialogResult.OK)
                     {
                         string fln = sfd.FileName;
                         img.Save(fln, ImageFormat.Png);
                     }
                 }
                 else
                 {
                     img.Save(spm.FSavePam.FileAutoPath + "\\" + spm.FSavePam.FileAutoName, ImageFormat.Png);
                 }
             }
         }
     }
 }