<div>Hey.</div><div><br></div><div>I'm trying to build a GUI for touch screen and want the widgets have certain dimensions in inches or millimeters, so I need to convert from pixels to centimeters or millimeters.</div>
<div><br></div><div>So the query is:</div><div><br></div><div><b>How do I convert pixels to centimeters?</b></div><div><br></div><div>What I found on the web is about to 1 pixel measured 0.03 inches apromadamente, but in practice the numbers did not close.</div>
<div><br></div><div>I tried doing something like this:</div><div><br></div><div><font color="#990000">gi import</font></div><div><font color="#990000">gi.repository import from GdkX11</font></div><div><font color="#990000"><br>
</font></div><div><font color="#990000"> screen = GdkX11.X11Screen()</font></div><div><br></div><div>After which, with: screen.width () get the horizontal resolution 1366, which multiplied by 0.03 gives me 40.98 while my monitor actually measures 34.5 cm.</div>
<div><br></div><div>Another function of GdkX11: screen.width_mm () returns me 361 millimeters.</div><div><br></div><div><br></div><div><div>Hola.</div><div><br></div><div>Estoy intentando construir una interfaz gráfica para touch screen y quiero que los widgets tengan determinadas dimensiones en centímetros o milímetros, por lo cual necesito convertir de pixels a centímetros o a milímetros.</div>
<div><br></div><div>De modo que la consulta es:</div><div><br></div><div>¿Cómo convierto pixels a centímetros?</div><div><br></div><div>Lo que he encontrado en la web gira en torno a que 1 pixel mide apromadamente 0.03 centímetros, pero en la práctica los números no me cierran.</div>
<div><br></div><div>He intentado hacer algo como esto:</div><div><br></div><div>import gi</div><div>from gi.repository import GdkX11</div><div><br></div><div>screen = GdkX11.X11Screen()</div><div><br></div><div>Luego de lo cual, con: screen.width() obtengo la resolución horizontal 1366, lo cual multiplicado por 0.03 me da 40.98 mientras que mi monitor mide en realidad 34.5 cm.</div>
<div><br></div><div>Otra función de GdkX11: screen.width_mm() me devuelve 361 milímetros.</div></div><div><br></div><div><br></div>