Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道网站可以检测用户的屏幕尺寸(以像素为单位),但有没有办法检测用户显示器的物理尺寸(以英寸为单位)?
这并不总是可能的。甚至操作系统也可能不知道这些信息。为了在屏幕上正确显示,必要的信息是显示器可以显示的分辨率。
考虑使用投影仪。根据您将投影机放置在离墙壁多远的位置,屏幕会变大或变小。但是,计算机会将相同的图片发送到投影仪。软件如何知道到墙壁的距离以及屏幕的大小?
不可靠。
即使是那些相信知道其 DPI(并不多)的显示器也常常是不正确的。
您可以使用注册表中的 EDID。
请为这个建议投票: https ://connect.microsoft.com/VisualStudio/feedback/details/526951/screen-object-physicalwidthincentimeters-physicalheightincentimeters-displaymode