How to Fix DPI-Aware Screen Capture in VB.NET and Visual Studio
Question details
The user needs to fix screen capture code in VB.NET that captures the incorrect screen area when Windows display scaling is set to 120 DPI.

- Product
- Visual Studio
- Device & OS
- Windows
- Scenario
- Developing a VB.NET application that utilizes screen-capture APIs on a high-DPI monitor.
- Observed behavior
- The screen-capture code captures the wrong screen area because it does not properly account for 120 DPI display scaling, leading to incorrect coordinate and bitmap dimensions.
Ensure you have your complete, reproducible VB.NET screen-capture code ready and note your exact Windows display scaling configuration (e.g., 120 DPI or 125%).
Consult the Developer Community on Stack Overflow
Since this is a specific VB.NET programming issue, the most effective solution is to seek help from the dedicated developer community.
Handling DPI awareness in older .NET Framework applications requires specific API calls to properly translate screen coordinates and bitmap dimensions. Community platforms like Stack Overflow are best suited for debugging code-level issues.
Gather your complete reproducible VB.NET screen-capture code, making sure to note both the expected results and the actual results you are seeing.
Go to the Stack Overflow website and log in to your developer account.
Create a new question detailing your Windows display scaling configuration and explaining exactly how screen coordinates and bitmap dimensions are currently calculated in your code.
Tag your question with 'vb.net', 'winforms', and 'dpi-awareness' to ensure it reaches developers with the right expertise.

Enable DPI Awareness in the Application Manifest
Configuring your application's manifest file to declare DPI awareness can prevent Windows from automatically virtualizing the screen coordinates.
Looking for a Lightweight Office Suite for Your Development Machine?
While you are debugging VB.NET and Visual Studio projects, you might need a fast, resource-friendly office suite to read documentation, write specs, or analyze data. WPS Office is a highly compatible, free alternative to Microsoft Office that won't slow down your development environment.
- 1. Visit the website: Go to the official WPS Office website to find the latest free version.
- 2. Download the installer: Click the 'Free Download' button to get the lightweight installation package.
- 3. Install and launch: Run the setup file and open WPS Office to start managing your documents.

Frequently Asked Questions
Why does my VB.NET screen capture cut off at high DPI?
When Windows display scaling is set above 100% (e.g., 120 DPI), Windows virtualizes coordinates for applications that are not declared as DPI-aware. This causes the standard screen-capture APIs to return scaled-down dimensions, resulting in only a portion of the screen being captured.
How do I make my WinForms application DPI-aware?
You can make a WinForms application DPI-aware by adding an app.manifest file to your project and uncommenting the <dpiAware> tag under the Windows settings section. Alternatively, you can call the SetProcessDPIAware() function via an API declaration before any UI elements are rendered.
Where is the best place to ask VB.NET and WinForms programming questions?
Stack Overflow is highly recommended for VB.NET programming questions. Be sure to include your reproducible code snippets, expected results, actual results, and relevant tags like 'vb.net', 'winforms', and 'dpi-awareness' to get the best responses.




