0

I use this (C# .NET) call to quickly get an image of a control.

Rectangle rectToCapture = myControl.RectangleToScreen(myControl.Bounds);

However, this only works if my Windows display scaling is set to 100%. If I set the display scaling to 125% this rectangle is totally wrong. How can I capture the correct rectangle regardless of scaling?

Mark Malburg
  • 125
  • 1
  • 9
  • Your app is *virtualized*, so you get *virtual* Screen measures. Make your app DpiAware. Start from here: [How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?](https://stackoverflow.com/a/13228495/7444103) – Jimi Feb 16 '21 at 13:36
  • Thanks Jimi - that solved it! https://social.msdn.microsoft.com/Forums/windows/en-US/4d3979d4-88df-44af-8b66-16b1d4d41d57/issue-with-vs2015-windows-form-dpi-and-screen-resolution?forum=winforms – Mark Malburg Feb 16 '21 at 13:43