Stop Firefox DPI Scaling (when Windows setting is at 125%)

You could easily let your website address users with settings at higher zoom levels by including a media query like: @media only screen and( -webkit-min-device-pixel-ratio: 1.25 ), only screen and( -o-min-device-pixel-ratio: 5/4 ), only screen and( min-resolution: 120dpi ), only screen and( min-resolution: 1.25dppx ) { body { font-size: 1rem; } } See this article … Read more

How do I convert a WPF size to physical pixels?

Transforming a known size to device pixels If your visual element is already attached to a PresentationSource (for example, it is part of a window that is visible on screen), the transform is found this way: var source = PresentationSource.FromVisual(element); Matrix transformToDevice = source.CompositionTarget.TransformToDevice; If not, use HwndSource to create a temporary hWnd: Matrix transformToDevice; … Read more

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

In any up-to-date Windows Insider builds (build >= 14342, SDK version# >= 14332) there is an EnableNonClientDpiScaling API (which takes an HWND as its argument) that will enable non-client DPI scaling for top-level HWNDs. This functionality requires that the top-level window be running in per-monitor DPI-awareness mode. This API should be called from the WM_NCCREATE … Read more

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

High DPI support is enabled from Qt 5.6 onward. Setting QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling) in your application source code allows automatic high-DPI scaling. NOTICE: To use the attribute method, you must set the attribute before you create your QApplication object: #include <QApplication> int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); return app.exec(); }

How to access screen display’s DPI settings via javascript? [duplicate]

Looks like you can use the ‘screen’ DOM object in IE, its got properties for deviceXDPI, deviceYDPI, logicalXDPI, logicalYDPI. https://www.w3schools.com/jsref/obj_screen.asp Here’s a solution from http://www.webdeveloper.com/forum/showthread.php?t=175278 (i havent tried it, seems like a total hack 🙂 Just create something 1 inch wide and measure it in pixels! console.log(document.getElementById(“dpi”).offsetHeight); #dpi { height: 1in; left: -100%; position: absolute; … Read more

Detecting the system DPI/PPI from JS/CSS?

<div id=’testdiv’ style=”height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;”></div> <script type=”text/javascript”> var devicePixelRatio = window.devicePixelRatio || 1; dpi_x = document.getElementById(‘testdiv’).offsetWidth * devicePixelRatio; dpi_y = document.getElementById(‘testdiv’).offsetHeight * devicePixelRatio; console.log(dpi_x, dpi_y); </script> grabbed from here http://www.infobyip.com/detectmonitordpi.php. Works on mobile devices! (android 4.2.2 tested)