Skip to content

Fix screenshot capture on high-DPI displays with Windows scaling#1

Draft
xtofuub with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-screenshot-functionality
Draft

Fix screenshot capture on high-DPI displays with Windows scaling#1
xtofuub with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-screenshot-functionality

Conversation

Copilot AI commented Feb 10, 2026

Copy link
Copy Markdown

Screenshots were only capturing partial screen content on laptops with Windows display scaling enabled (125%, 150%, 200%).

Root Cause

SystemInformation.VirtualScreen returns logical pixels while Graphics.CopyFromScreen() operates on physical pixels. On a laptop with 150% scaling:

  • VirtualScreen reports 1920×1080 (logical)
  • CopyFromScreen expects 2880×1620 (physical)
  • Result: Only 67% of screen captured

Changes

  • DPI awareness: Call SetProcessDPIAware() to align all coordinate systems to physical pixels
  • Screen enumeration: Replace VirtualScreen with Screen.AllScreens and calculate bounds explicitly:
    $screens = [System.Windows.Forms.Screen]::AllScreens
    $left = ($screens | ForEach-Object { $_.Bounds.Left } | Measure-Object -Minimum).Minimum
    $width = ($screens | ForEach-Object { $_.Bounds.Right } | Measure-Object -Maximum).Maximum - $left
  • Bounds calculation: Compute total virtual desktop bounds across all monitors for multi-monitor support

The DPI awareness call is wrapped in try-catch since it may already be set by the host process.

Original prompt

in laptop when doing /screenshot it doesnt screenshot the whole screen


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 10, 2026 09:29
Co-authored-by: xtofuub <99559348+xtofuub@users.noreply.github.com>
Co-authored-by: xtofuub <99559348+xtofuub@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix screenshot functionality to capture the whole screen Fix screenshot capture on high-DPI displays with Windows scaling Feb 10, 2026
Copilot AI requested a review from xtofuub February 10, 2026 09:33

@xtofuub xtofuub left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants