Пример #1
0
        public void CreateImageFromBitmap(System.Windows.Media.Imaging.BitmapSource bitmap)
        {
            var imageWindow = new Utils.CapturedImage();

            this.imageWindows.Add(imageWindow);
            imageWindow.Owner = this;
            imageWindow.SetImage(bitmap);
            imageWindow.SetName(this.GenerateNewImageName());
            imageWindow.Show();
        }
Пример #2
0
 private void CaptureFromDiskButton_Click(object sender, RoutedEventArgs e)
 {
     using (var screenshot = new Utils.Movable <System.Drawing.Bitmap>(Utils.ScreenShooting.LoadImage()))
     {
         if (screenshot.Get() != null)
         {
             var imageWindow = new Utils.CapturedImage();
             this.imageWindows.Add(imageWindow);
             imageWindow.Owner = this;
             imageWindow.SetImage(screenshot.Release());
             imageWindow.SetName(this.GenerateNewImageName());
             imageWindow.Show();
         }
     }
 }
Пример #3
0
 private void CaptureFromClipboard()
 {
     try
     {
         using (var screenshot = new Utils.Movable <System.Drawing.Bitmap>(Utils.ScreenShooting.CaptureImageFromClipboard()))
         {
             var imageWindow = new Utils.CapturedImage();
             this.imageWindows.Add(imageWindow);
             imageWindow.Owner = this;
             imageWindow.SetImage(screenshot.Release());
             imageWindow.SetName(this.GenerateNewImageName());
             imageWindow.Show();
         }
     }
     catch (System.NullReferenceException)
     {
         MessageBox.Show("There is no valid image in the Clipboard", "Failure", MessageBoxButton.OK);
     }
 }