简体   繁体   English

RectangleToScreen 和 Windows 缩放系数

[英]RectangleToScreen and Windows Zoom Factor

I use this (C# .NET) call to quickly get an image of a control.我使用这个 (C# .NET) 调用来快速获取控件的图像。

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

However, this only works if my Windows display scaling is set to 100%.但是,这仅在我的 Windows 显示缩放设置为 100% 时才有效。 If I set the display scaling to 125% this rectangle is totally wrong.如果我将显示比例设置为 125%,这个矩形是完全错误的。 How can I capture the correct rectangle regardless of scaling?无论缩放如何,如何捕获正确的矩形?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM