我需要屏幕DPI,所以我可以相应地调整我的程序。
所以我的问题是如何使用VB.NET检测屏幕DPI?
答案 0 :(得分:0)
试试这个:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim g As Graphics = Me.CreateGraphics()
MessageBox.Show("ScreenWidth:" & Screen.PrimaryScreen.Bounds.Width & " ScreenHeight:" & Screen.PrimaryScreen.Bounds.Height & vbCrLf & " DpiX:" & g.DpiX & " DpiY:" & g.DpiY)
End Sub