improve:任务栏高度计算

This commit is contained in:
2025-07-25 18:02:46 +08:00
parent 4efd6abb56
commit 616df56657
3 changed files with 11 additions and 1 deletions
@@ -93,5 +93,15 @@ namespace Ink_Canvas.Helpers
return "Unknown";
}
}
public static double GetTaskbarHeight(System.Windows.Forms.Screen screen, double dpiScaleY)
{
// 获取工作区和屏幕高度的差值
var workingArea = screen.WorkingArea;
var bounds = screen.Bounds;
int taskbarHeight = bounds.Height - workingArea.Height;
// 考虑 DPI 缩放
return taskbarHeight / dpiScaleY;
}
}
}