【问题标题】:How to detect the screen DPI using VB.NET?如何使用 VB.NET 检测屏幕 DPI?
【发布时间】:2018-06-16 18:37:54
【问题描述】:

我需要屏幕 DPI,以便我可以相应地调整我的程序。

所以我的问题是如何使用 VB.NET 检测屏幕 DPI?

【问题讨论】:

标签: windows vb.net


【解决方案1】:

试试这个:

    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

【讨论】:

    猜你喜欢
    • 2012-03-06
    • 2010-11-06
    • 1970-01-01
    • 1970-01-01
    • 2011-01-15
    • 1970-01-01
    • 1970-01-01
    • 2013-09-24
    相关资源
    最近更新 更多