Exemple #1
0
        /// <summary>
        /// Captures the image.
        /// </summary>
        public void CaptureImage()
        {
            Bitmap image = null;

            // if the show advanced is not visible;  then always capture the current area
            if (this.SelectedProcessItem == null || this.ShowAdvanced == false)
            {
                // capture only the background
                this.uiWindow.HideWin();
                image = WindowSnap.GetCurrentBackgroundScreenShot() as Bitmap;
                this.IsApplicationVisible = true;
                this.uiWindow.ShowWin();
            }
            else
            {
                var snap = WindowSnap.GetWindowSnap(this.SelectedProcessItem.WindowHandle, true);
                image = snap.Image;
            }

            string fileName = this.SaveImage(image as Bitmap);
        }