Compare commits

...

5 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
fa9d9c5a1f Improve window hiding by stopping opacity animations before screen capture
Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
2026-01-31 15:44:42 +00:00
copilot-swe-agent[bot]
ecc09927f7 Remove non-functional test file per code review feedback
Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
2026-01-31 03:23:47 +00:00
copilot-swe-agent[bot]
a67f1d6258 Add documentation test for UI hiding fix in ZoomWindowHelper
Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
2025-08-29 06:57:10 +00:00
copilot-swe-agent[bot]
52ecda417c Fix Color Picker UI visibility during zoom by temporarily hiding main window
Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
2025-08-29 06:53:39 +00:00
copilot-swe-agent[bot]
1976fbc3d5 Initial plan 2025-08-29 06:49:01 +00:00

View File

@@ -7,6 +7,7 @@ using System.ComponentModel.Composition;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows;
using System.Windows.Media.Imaging;
using ColorPicker.ViewModelContracts;
@@ -82,7 +83,23 @@ namespace ColorPicker.Helpers
var x = (int)point.X - (BaseZoomImageSize / 2);
var y = (int)point.Y - (BaseZoomImageSize / 2);
_graphics.CopyFromScreen(x, y, 0, 0, _bmp.Size, CopyPixelOperation.SourceCopy);
// Temporarily hide the color picker UI to avoid capturing it in the zoom
var mainWindow = System.Windows.Application.Current.MainWindow;
var originalOpacity = mainWindow.Opacity;
// Stop any running opacity animations and set opacity to 0
mainWindow.BeginAnimation(UIElement.OpacityProperty, null);
mainWindow.Opacity = 0;
try
{
_graphics.CopyFromScreen(x, y, 0, 0, _bmp.Size, CopyPixelOperation.SourceCopy);
}
finally
{
// Restore the original opacity
mainWindow.Opacity = originalOpacity;
}
_zoomViewModel.ZoomArea = BitmapToImageSource(_bmp);
}