【发布时间】:2011-04-19 15:51:44
【问题描述】:
我在 intertubes 上看到了这段代码,用于确定 Windows Mobile 设备是否具有 VGA 屏幕(代码位于 Form 类的方法中):
SizeF currentScreen = this.CurrentAutoScaleDimensions;
bool isVGA = currentScreen.Height == 192;
是否有可能因为浮动不精确(Height 属性是一个浮动)而即使屏幕是 VGA 也可以将 isVGA 设置为 false?
【问题讨论】:
-
所以我认为您的问题实际上是 CurrentAutoScaleDimensions 是否可以返回非整数浮点值?
标签: c# floating-point windows-mobile compact-framework