【问题标题】:dotnet compact framework 3.5 sp1 detect device resolutiondotnet compact framework 3.5 sp1 检测设备分辨率
【发布时间】:2010-09-17 03:56:26
【问题描述】:

我需要自动检测设备分辨率,现在我有一个全局变量并硬连线分辨率:

Public gDeviceRes As String = "640"
'Public gDeviceRes As String = "320"

然后为每个设备重新编译,有没有人有一个快速的代码片段??

【问题讨论】:

    标签: windows-mobile compact-framework


    【解决方案1】:

    根据您的具体需求,您可以使用Screen.PrimaryScreen 检查当前屏幕尺寸,也可以使用 SM_CXSCREEN 或GetDeviceCaps 使用 HORZRES P/Invoke GetSystemMetrics。垂直尺寸同样可用。

    【讨论】:

      【解决方案2】:

      这正是我需要的:

        Dim screensize As System.Drawing.Rectangle = Screen.PrimaryScreen.Bounds
        Public gDeviceRes As String = screensize.Height
      

      【讨论】:

        猜你喜欢
        • 2010-09-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-06-14
        • 2011-10-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多