是否可以获得用户的物理屏幕大小,而不使用物理对象或对角线测量? [英] Is it possible to get a users physical screen size without the use of a physical object or the diagonal measurement?

查看:114
本文介绍了是否可以获得用户的物理屏幕大小,而不使用物理对象或对角线测量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题说的一切真的。我想要能够显示实际大小的东西,所以,例如,如果在浏览器中显示的东西为20厘米,我想能够测量它,它实际上是20厘米。

Question says it all really. I want to be able to display something at actual size, so, for example, if something is displayed in the browser as 20cm, I want to be able to measure it and it to actually be 20cm.

到目前为止,我已经遇到了解决方案,考虑到屏幕的对角线分辨率(例如21.5英寸)和屏幕分辨率来计算像素的大小。

So far I have come across solutions which take into account the diagonal resolution of the screen (such as 21.5 inches) and the screen resolution to calculate how big a pixel is.

另一种方法是要求用户在屏幕上放置一张标准尺寸的卡片,如银行卡,并测量边缘以计算尺寸。

Another approach is to ask the user to put up a standard sized card such as a bank card to the screen and measure the edges to calculate the size.

有没有办法在屏幕上没有物理对象,或没有用户需要知道他们的对角屏幕尺寸?

Is there a way to do this without a physical object on the screen or without the user needing to know their diagonal screen size?

请让我知道如果你知道任何不同的解决方案,除了我提到的。

Please also let me know if you know of any different solutions other than the ones I have mentioned.

推荐答案

你绝对不能这样做,例如,如果显示设备不是屏幕,而是视频投影仪,则有效尺寸将取决于投影仪到墙壁的距离,这可以在没有操作系统获得任何反馈的情况下改变。

You can't do this with absolute certainty, no. For example, if the display device is not a screen, but a video projector, the effective size will depend on the distance of the projector to the wall, which can change without the operation system getting any feedback.

大多数操作系统有一些dpi设置(每英寸点数),可以由用户或系统管理员配置,硬编码视频设备已内置,无法更改,例如笔记本电脑屏幕),或者可能会自动发现(如果视频协议支持此功能)。

Most operation systems have some dpi setting (dots per inch), which might either be configured by the user or system administrator, hard-coded (if the video device is build in and can't be changed, like a laptop screen), or maybe automatically discovered (if the video protocol supports this).

浏览器将使用类似的浏览器设置来计算CSS中使用的绝对大小,例如 cm mm code>在, pt 等。

Either this setting or a similar browser setting will be used by the browser to calculate absolute sizes used in CSS, like cm, mm, in, pt, and so on.

可以简单地依赖于浏览器来显示它的正确,或者告诉你的用户设置设置权。 (当然,在投影尺寸为3×4米的视频投影仪上,你不想显示一个20厘米的物体。)

So you could simply rely on the browser to show it right, or tell your user to set the setting right. (Of course, on a video projector with projection size 3×4 m you don't really want to show a 20 cm object.)

这篇关于是否可以获得用户的物理屏幕大小,而不使用物理对象或对角线测量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆