Exemplo n.º 1
0
        private void ConvertCompleted(ImageConverter cp) // Called on UI thread
        {
            if (cp.Converted && cp.CopyToClipboard)
            {
                using (Image bmp = Bitmap.FromFile(cp.OutputFilename))
                {
                    try
                    {
                        Clipboard.SetImage(bmp);
                    }
                    catch
                    {
                        _discoveryForm.LogLineHighlight("Copying image to clipboard failed");
                    }
                }
            }

            if (cp.Preview)        // if preview, load in
            {
                pictureBox.ImageLocation = cp.OutputFilename;
                pictureBox.SizeMode      = PictureBoxSizeMode.StretchImage;
            }

            OnScreenShot?.Invoke(cp.OutputFilename, cp.FinalSize);
        }
Exemplo n.º 2
0
        private void ConvertCompleted(ScreenShotImageConverter cp) // Called by the watcher when a convert had completed, in UI thread
        {
            System.Diagnostics.Debug.Assert(Application.MessageLoop);

            if (cp.Converted && cp.CopyToClipboard)
            {
                using (Image bmp = Bitmap.FromFile(cp.OutputFilename))
                {
                    try
                    {
                        Clipboard.SetImage(bmp);
                    }
                    catch
                    {
                        discoveryform.LogLineHighlight("Copying image to clipboard failed");
                    }
                }
            }

            OnScreenShot?.Invoke(cp.OutputFilename, cp.FinalSize);
        }
Exemplo n.º 3
0
 public ScreenShotCallback(OnScreenShot onScreenShot) : base("com.nibiru.lib.vr.listener.NVRScreenShotListener")
 {
     mOnScreenShot = onScreenShot;
 }