简体   繁体   English

如何通过代码以编程方式将“覆盖高 DPI 缩放”设置为“应用程序”

[英]How to set “Override high DPI scaling” to “Application” programmatically through code

We have a control inside a activex control that suffers from graphical artifacts on Windows 10. It works fine in Windows 7. The only way we have been able to fix the artifacts is by changing the exe setting pictured below.我们在 Activex 控件中有一个控件,该控件在 Windows 10 上存在图形伪影。它在 Windows 7 中运行良好。我们能够修复伪影的唯一方法是更改下图所示的 exe 设置。

高 DPI 缩放覆盖

Is there a way to change it through code (Visual Studio 2017 c#)?有没有办法通过代码(Visual Studio 2017 c#)来改变它? In our project we dont have a manifest file in project.在我们的项目中,我们的项目中没有清单文件。

I was able to get through using the below script and save as bat file and execute it in the code to set DPI scaling我能够通过使用下面的脚本并保存为 bat 文件并在代码中执行它来设置 DPI 缩放

@echo off title This is to set HIGHDPI Scaling @echo off title 这是设置HIGHDPI缩放

REG ADD "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "C:\Program Files (x86)\VidSys\VidSys Out-of-Process Viewer Framework\External Process\NvrViewerExternalProcess.exe" /T REG_SZ /D ~HIGHDPIAWARE /F REG ADD "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "C:\Program Files (x86)\VidSys\VidSys 进程外查看器框架\外部进程\NvrViewerExternalProcess.exe" /T REG_SZ /D ~HIGHDPIAWARE /F

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

相关问题 更改c#中的“覆盖高DPI缩放行为” - Change “Override high DPI scaling behavior” in c# 禁用高 DPI 缩放 - Disable high DPI scaling Winforms应用程序在绘制图表时更改高dpi监视器上的缩放比例 - Winforms application changes scaling on high dpi monitor when drawing a chart WinForm 的 Windows 高 DPI 缩放 - Windows High DPI Scaling for WinForm .NET WinForms 高 DPI 缩放 - 如何在显示设置更改后强制 forms 正确显示? - .NET WinForms high DPI Scaling - how to force forms to display correctly after display settings change? WinForms:如何修复 Forms 在具有不同分辨率/缩放的高 DPI、多监视器环境 (PerMonitorV2) 中的不正确缩放 - WinForms: How to fix incorrect scaling of Forms in high-DPI, multi-monitor environments (PerMonitorV2) with different resolution/scaling 无法让NotifyIcon加载高DPI资源以进行DPI缩放> = 150% - Can't get NotifyIcon to load high DPI resource for DPI scaling >= 150% 如何创建与Windows 7向后兼容的缩放和大小更改Per-Monitor DPI感知应用程序? - How to create a scaling and size-changing Per-Monitor DPI-aware application that is backwards compatible with Windows 7? 如何在 C# 中更改 DPI 缩放行为 - How to Change DPI Scaling behavior in C# Windows 8中的字体缩放与Windows 7中的字体缩放(在高DPI下-144) - Font Scaling in Windows 8 vs Font Scaling in Windows 7 (under high DPI - 144)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM