dpi

How do dp, dip, dpi, ppi, pixels and inches relate?

主宰稳场 提交于 2019-11-29 00:09:14
问题 I was reading dp, dip, px, sp measurements, but I still have some questions about dp/dpi vs ppi vs px vs inch. I am not able to compare them... is an inch the largest? They say 160 dpi means 160 pixels per one inch. Does that mean 1 inch contains 160 pixels? They also say 1 pixel on a 160 dpi screen = 1 dp. Does that mean 1 pixel and 1 dp are equal? And lastly, why should we use dp instead of px? I understand that it is ideal, but why ? 回答1: You should (almost) always use flexible sizing

设备分辨率与像素密度对网页缩放的影响

女生的网名这么多〃 提交于 2019-11-28 20:28:16
此处设置一个默认分辨率 1920*1080 , 设备尺寸15.6吋. (一般笔记本尺寸和分辨率) 默认dpi(win屏幕一般为72或96dpi) (PS默认新建文档默认值72, 72一般在网络上传输,300dip用于输出打印) 当设备的分辨率和设备尺寸不变的情况下,设备屏幕dpi(win屏幕一般为72或96dpi)在高于某个值(72或96dpi)的时候。屏幕的dpi就会影响网页缩放(从而影响网页布局) 屏幕dpi是如何变化的呢? 默认情况下:设备尺寸过小 , 分辨率过高导致设备dpi大于每英寸/72像素, windows会自动对屏幕显示进行放大 . 进而导致浏览器展示的网页被放大 (从而导致网页中、字体、元素尺寸变大,导致网页布局错乱)。 开发者为了调试在不同dpi下网页的缩放和布局故意更改设备dpi。 win10 调整dpi 125%、150%、175%、200%、300%代表放大等级,数值会由 windows系统自动设置,同时自己也可手动设置。 苹果手机4s以后与苹果电脑retina屏 都代表着 系统dpi大于72或96或115dpi。 附常用尺寸表以及dpi https://uiiiuiii.com/screen/ 默认情况下,手机的尺寸较小,分辨率过大(1080或2k)导致设备dpi非常高(一般400以上)所以这就导致了网页在手机上字体会被放大 解决方案 设置CSS

Printing page with bootstrap 3

这一生的挚爱 提交于 2019-11-28 17:27:59
I've been looking through a lot of answers here on stackoverflow that semi-cover what I'm wondering about, but haven't found anything that worked for me. I understand that the printing page is about 550 px for A4 and therefor bootstrap will use the styles and layout usually used for mobile devices. When I use Ctrl+P for my web page, the printable page looks just like the mobile version of my page. But how do I make it look like the desktop version? (media > 1024 px) Is there a way to do this? I know I can change the css specifically for print. But how to solve this thing with the bootstrap 3

Scaling the non-client area (title bar, menu bar) for per-monitor high-DPI support

我的梦境 提交于 2019-11-28 16:51:03
Windows 8.1 introduced the ability to have different DPI settings for different monitors. This feature is known as "per-monitor high-DPI support." It persists and has been further refined in Windows 10. If an application does not opt in ( i.e. , is either DPI-unaware or high-DPI aware), it will be automatically scaled up by DWM to the proper DPI. Most applications fall into one of these two categories, including most of the utilities bundled with Windows ( e.g. , Notepad). On my test system, the high-DPI monitor is set to 150% scale (144 DPI), while the normal monitor is set to the system DPI

Changing DPI scaling size of display make Qt application's font size get rendered bigger

蓝咒 提交于 2019-11-28 16:32:26
I have created some GUI application using Qt. My GUI application contains controls like push button and radio button. When I run the application, buttons and fonts inside button looks normal. When I change the DPI scaling size of display from 100% to 150% or 200%, font size of controls rendered bigger but not control size (pushbutton, radio button) irrespective of resolution. Due to this the text inside controls were cut off. please see the attached image. Qt application look when DPI scaling size set to 100% Qt application look when DPI scaling size set to 200% I am running my application in

Win10强制程序高DPI缩放设置

旧时模样 提交于 2019-11-28 16:28:28
起因 工作原因,需要在win10上安装数个古老vc版本(vc6,vc2008,vc2010),但是显示器是2K的,DPI缩放有问题 尝试 VC6比较好解决: 右键,属性,兼容性,更改高DPI设置,勾选替代高DPI缩放行为 一气呵成(经常配置) VC2008和VC2010就比较蛋疼了,属性里面没有兼容性这个选项卡 解决 关键字搜索 win10 visual studio 2008 dpi fix ,结果指向 devenv.exe.mainfest 设置,实际无效 尝试复制VC6兼容设置,导入以下注册表即可 Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers] "C:\\Program Files (x86)\\Microsoft Visual Studio\\Common\\MSDev98\\Bin\\MSDEV.EXE"="~ PERPROCESSSYSTEMDPIFORCEOFF HIGHDPIAWARE" "C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe"="~

How to Check Photo DPI with PHP [duplicate]

寵の児 提交于 2019-11-28 12:24:22
Possible Duplicate: Get/set DPI with PHP GD/Imagick? Is there a possible way to check photo dpi with php. I have 300 dpi and 72 dpi photos. but wants a way to calculate dpi automatically. It's too late for me to check now but I think you're looking for Imagick::getImageResolution() and Imagick::setImageResolution() if you need to change the DPIs. I don't think this is possible with GD, I believe it "converts" all images to 72 DPIs. Naeem If you want it without Imagick or GD Library . I was struggling with this, and since I found it, here you go. function get_dpi($filename){ $a = fopen(

How do I detect if the user's font (DPI) is set to small, large, or something else?

人走茶凉 提交于 2019-11-28 12:16:58
I need to find out if the user's screen is set to normal 96 dpi (small size), large 120 dpi fonts, or something else. How do I do that in VB.NET (preferred) or C#? The best way is just to let the form resize itself automatically, based on the user's current DPI settings. To make it do that, just set the AutoScaleMode property to AutoScaleMode.Dpi and enable the AutoSize property. You can do this either from the Properties Window in the designer or though code: Public Sub New() InitializeComponent() Me.AutoScaleMode = AutoScaleMode.Dpi Me.AutoSize = True End Sub Or, if you need to know this

GetSystemMetrics() returns wrong value for SM_CXSCREEN

放肆的年华 提交于 2019-11-28 12:10:12
I've run into an interesting problem. At least in Vista, getSystemMetrics(SM_CXSCREEN) returns an incorrect value when the desktop DPI settings aren't set at 100%. For example, I tried 150% in a 1366x768 screen and getSystemMetrics() returns 911 instead of 1366 (and 1366 / 1.5 ~ 911) According to the MSDN, getSystemMetrics(SM_CXSCREEN) returns pixels, so I thought this value wouldn't be affected by the DPI settings - but it is. So is there a safer way to find out the true, unscaled screen resolution? A program must tell the operating system that it is DPI-aware to get the true resolution when

Detect if non DPI-aware application has been scaled/virtualized

Deadly 提交于 2019-11-28 11:21:35
I'm trying to detect in a WinForms application if it has been launched in scaled/virtualized mode due to the OS having a high DPI. Currently, in a system running at 3840x2400 with 200% scaling, the application sees the resolution as 1920x1200, the DPI as 96, and the scale factor is 1. We are in the process of making the application DPI-aware, but until then, we need a "quick fix" that will allow us to detect if scaled. The reason for this is that it breaks a functionality in the application that takes a screenshot. We use the scaled dimensions in Graphics.CopyFromScreen, it takes a screenshot