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(); }

Pixel to Centimeter?

Similar to this question which asks about points instead of centimeters. There are 72 points per inch and there are 2.54 centimeters per inch, so just substitute 2.54 for 72 in the answer to that question. I’ll quote and correct my answer here: There are 2.54 centimeters per inch; if it is sufficient to assume … Read more

Load dimension value from res/values/dimension.xml from source code

In my dimens.xml I have <dimen name=”test”>48dp</dimen> In code If I do int valueInPixels = (int) getResources().getDimension(R.dimen.test) this will return 72 which as docs state is multiplied by density of current phone (48dp x 1.5 in my case) exactly as docs state : Retrieve a dimensional for a particular resource ID. Unit conversions are based … Read more

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

Disable DPI awareness for WPF application

DPIAwareness Just some ideas (not tried): Are you running on XP? That option might not work on that platform. http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/5e60a54d-baf5-46e3-9eac-a959f2a0fba1/ What follows are probably just different ways to set the same DpiAwareness option: look at the “compatibility mode” settings on your EXE…right click it’s properties…and turn on “Disable display scaling” create a manifest, and say … Read more

How do I convert ppi into dpi for Android images?

Dp are Density independant pixels and are used to generalise the number of pixels a screen has. These are generalised figures taken from http://developer.android.com/guide/practices/screens_support.html xlarge screens are at least 960dp x 720dp large screens are at least 640dp x 480dp normal screens are at least 470dp x 320dp small screens are at least 426dp x … Read more

How can I set the dpiAware property in a Windows application manifest to “per monitor” in Visual Studio?

New in Windows 10 is dpiAwareness as well as dpiAware, so we need to update this example a bit. Now, it is fine because if dpiAwareness does not exist, then the settings will be inherited from dpiAware. To enable DPI awareness in full, with the latest Win10 support (see Ref URL for other possible options), … Read more