logo
search
Others

How to Fix DPI-Aware Screen Capture in VB.NET and Visual Studio

Tauseeq MagsiTauseeq Magsi Sep 25, 2026 869 views

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.

How to Fix DPI-Aware Screen Capture in VB.NET and Visual Studio
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.
Before you start

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%).

Solution 1Recommended

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.

1
Prepare your code

Gather your complete reproducible VB.NET screen-capture code, making sure to note both the expected results and the actual results you are seeing.

2
Navigate to Stack Overflow

Go to the Stack Overflow website and log in to your developer account.

3
Draft your question

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.

4
Add the correct tags

Tag your question with 'vb.net', 'winforms', and 'dpi-awareness' to ensure it reaches developers with the right expertise.

Consult the Developer Community on Stack Overflow
Third-Party Resources: Microsoft does not provide warranties for information found on third-party developer websites like Stack Overflow.
Free Microsoft Office alternative

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. 1. Visit the website: Go to the official WPS Office website to find the latest free version.
  2. 2. Download the installer: Click the 'Free Download' button to get the lightweight installation package.
  3. 3. Install and launch: Run the setup file and open WPS Office to start managing your documents.
Fully compatible with Microsoft Office formats (DOCX, XLSX, PPTX).Lightweight installation leaves more system resources free for Visual Studio and heavy workloads.All-in-one tabbed interface for managing PDFs, spreadsheets, and documentation seamlessly.Free to use with a familiar UI, requiring zero learning curve for developers.
microsoft office alternative - wps office

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.