使用PerMonitorV2

This commit is contained in:
ww-rm
2025-04-20 23:13:37 +08:00
parent 71ff8007fb
commit fcd809fda5
2 changed files with 4 additions and 1 deletions

View File

@@ -736,7 +736,9 @@ namespace SpineViewer.Controls
var screenBounds = Screen.FromControl(this).Bounds; var screenBounds = Screen.FromControl(this).Bounds;
Resolution = screenBounds.Size; Resolution = screenBounds.Size;
spinePreviewFullScreenForm.Controls.Add(panel_RenderContainer); spinePreviewFullScreenForm.Controls.Add(panel_RenderContainer);
spinePreviewFullScreenForm.Bounds = screenBounds; spinePreviewFullScreenForm.Location = screenBounds.Location;
spinePreviewFullScreenForm.Size = screenBounds.Size;
//spinePreviewFullScreenForm.Bounds = screenBounds; // XXX: DPI 在 V2 模式下貌似有奇怪的缓存 BUG 导致通过 Bounds 设置位置时 Size 无法在第一次正确响应
spinePreviewFullScreenForm.Show(); spinePreviewFullScreenForm.Show();
PropertyGrid?.Refresh(); PropertyGrid?.Refresh();
} }

View File

@@ -11,6 +11,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>appicon.ico</ApplicationIcon> <ApplicationIcon>appicon.ico</ApplicationIcon>
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
<GenerateResourceWarnOnBinaryFormatterUse>false</GenerateResourceWarnOnBinaryFormatterUse> <GenerateResourceWarnOnBinaryFormatterUse>false</GenerateResourceWarnOnBinaryFormatterUse>
</PropertyGroup> </PropertyGroup>