Snip() public static method

public static Snip ( ) : Image
return Image
Beispiel #1
0
        public void SnipAndSend()
        {
            Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() =>
            {
                _main.Visibility = Visibility.Hidden;
                debug.MinizeSkypeWindows();
                try
                {
                    using (var bmp = SnippingTool.Snip())
                    {
                        _main.Visibility = Visibility.Visible;
                        if (bmp != null)
                        {
                            SaveSnip(bmp);
                            DoSendImage(DataFromImage(bmp, useMaxWidth: false));

                            try
                            {
                                System.Windows.Forms.Clipboard.SetImage(bmp);
                            }
                            catch (Exception)
                            {
                                // ignore
                            }
                        }
                    }
                }
                finally
                {
                    _main.Visibility = defaultVisibility;
                }
                debug.RestoreSkypeWindows();
            }));
        }
Beispiel #2
0
 public void Snip()
 {
     _main.Visibility = Visibility.Hidden;
     Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle, new Action(() =>
     {
         try
         {
             using (var bmp = SnippingTool.Snip())
             {
                 _main.Visibility = Visibility.Visible;
                 if (bmp != null)
                 {
                     SaveSnip(bmp);
                     System.Windows.Forms.Clipboard.SetImage(bmp);
                 }
             }
         }
         finally
         {
             _main.Visibility = Visibility.Visible;
         }
     }));
 }