When capturing a screenshot of a window (e.g. using CaptureToFile() or Capture(), etc.), the resulting image includes some pixels around the actual window, which appears to reflect the shadow including the background shining through. This happens at least my WPF application on Windows 10.
Is there a way to exclude the shadow from the screenshot?