Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Native DPI
Re: Native DPI [message #44697 is a reply to message #44696] |
Wed, 27 May 2015 13:32   |
Tom1
Messages: 1303 Registered: March 2007
|
Ultimate Contributor |
|
|
Hi,
Thanks! Your icon scalings and other changes work well across the displays. (Of course, icons are not as sharp on UHD as one might wish, but this is a minor issue.) Drop lists and some other items still have rather small arrow heads compared to the button size. Also, the check marks in front of menu items are perhaps slightly small. On secondary display there is an overall fuzzyness issue, but more on that can be found below.
--
Multi display:
The current code for reading font height returns the same exact value regardless the monitor the window is dragged to. (Declaring the process PM aware or not, does not have any effect to the result.)
Unless the process is declared per-monitor hi-dpi aware, the entire window contents look fuzzy on the smaller FullHD (secondary) display because of Windows scaling for non-per-monitor-hi-dpi-compliant applications. Declaring per-monitor hi-dpi support for the application removes the fuzzyness, but everything grows in size because the fonts and everything else around retains the same size in pixels now. So, the application should be able to handle the DPI change now.
IMO: Proper per-monitor hidpi support in upp would:
- Work on per-TopWindow basis
- First detect the primary display DPI using GetDeviceCaps(handle,LOGPIXELSX) and read the system default font size using the current code.
- Then the actual StdFontSize would be calculated based on the above and the TopWindow hosting display reported DPI from received WM_DPICHANGED messages
--
I'm now aware of the stupid way Windows reports DPI values. It is simply a user setting of type: 'How large items would you like to have on your screen?'. So there is nothing there to work on towards scaling e.g. a map content on screen to a real scale. In order to implement true map scaling in my software, I would need two things: The pixel resolution of the display the window is currently hosted on and the diagonal size of the monitor involved. I'm afraid the diagonal size needs to be manually input by the user, but the pixel resolution can be read from Windows using code similar to this when WM_DPICHANGED message arrives:
MONITORINFO mi;
Zero(mi);
mi.cbSize=sizeof(MONITORINFO);
if(GetMonitorInfo(MonitorFromWindow(hWnd,MONITOR_DEFAULTTONEAREST),&mi)){
Rect monitor_resolution(mi.rcMonitor);
Hopefully this code can be embedded in TopWindow's message loop and the resulting pixel resolution of current monitor exposed through some TopWindow function.
Best regards,
Tom
|
|
|
 |
|
Native DPI
By: Tom1 on Thu, 21 May 2015 11:45
|
 |
|
Re: Native DPI
By: mirek on Sat, 23 May 2015 20:23
|
 |
|
Re: Native DPI
By: Tom1 on Sun, 24 May 2015 10:29
|
 |
|
Re: Native DPI
By: mirek on Sun, 24 May 2015 21:16
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 25 May 2015 10:05
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 25 May 2015 16:54
|
 |
|
Re: Native DPI
By: mirek on Mon, 25 May 2015 23:13
|
 |
|
Re: Native DPI
|
 |
|
Re: Native DPI
By: Tom1 on Tue, 26 May 2015 10:22
|
 |
|
Re: Native DPI
By: mirek on Wed, 27 May 2015 10:03
|
 |
|
Re: Native DPI
By: mirek on Wed, 27 May 2015 10:14
|
 |
|
Re: Native DPI
By: Tom1 on Wed, 27 May 2015 13:32
|
 |
|
Re: Native DPI
By: mirek on Wed, 27 May 2015 14:13
|
 |
|
Re: Native DPI
By: Tom1 on Thu, 28 May 2015 09:47
|
 |
|
Re: Native DPI
By: mirek on Fri, 29 May 2015 10:16
|
 |
|
Re: Native DPI
By: mirek on Fri, 29 May 2015 13:27
|
 |
|
Re: Native DPI
By: Tom1 on Fri, 29 May 2015 17:23
|
 |
|
Re: Native DPI
By: mirek on Sat, 06 June 2015 07:37
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 08 June 2015 10:31
|
 |
|
Re: Native DPI
By: mirek on Sat, 13 June 2015 17:04
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 15 June 2015 00:00
|
 |
|
Re: Native DPI
By: mirek on Mon, 15 June 2015 14:01
|
 |
|
Re: Native DPI
By: Tom1 on Tue, 16 June 2015 22:13
|
 |
|
Re: Native DPI
By: mirek on Tue, 16 June 2015 23:37
|
 |
|
Re: Native DPI
By: Tom1 on Wed, 17 June 2015 10:02
|
 |
|
Re: Native DPI
By: mirek on Fri, 19 June 2015 08:26
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 22 June 2015 11:52
|
 |
|
Re: Native DPI
By: Tom1 on Fri, 26 June 2015 09:13
|
 |
|
Re: Native DPI
By: mirek on Mon, 03 August 2015 20:11
|
 |
|
Re: Native DPI
By: Tom1 on Wed, 05 August 2015 13:03
|
 |
|
Re: Native DPI
By: mirek on Wed, 05 August 2015 14:56
|
 |
|
Re: Native DPI
By: Tom1 on Wed, 05 August 2015 15:50
|
 |
|
Re: Native DPI
By: mirek on Sun, 09 August 2015 13:22
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 10 August 2015 11:12
|
 |
|
Re: Native DPI
By: Tom1 on Thu, 13 August 2015 12:22
|
 |
|
Re: Native DPI
By: mirek on Tue, 18 August 2015 20:10
|
 |
|
Re: Native DPI
By: Tom1 on Wed, 19 August 2015 13:07
|
 |
|
Re: Native DPI
By: mirek on Wed, 19 August 2015 22:35
|
 |
|
Re: Native DPI
By: Tom1 on Sat, 22 August 2015 09:56
|
 |
|
Re: Native DPI
By: mirek on Sun, 23 August 2015 12:23
|
 |
|
Re: Native DPI
By: Tom1 on Sat, 29 August 2015 13:54
|
 |
|
Re: Native DPI
By: mirek on Sat, 29 August 2015 18:26
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 31 August 2015 10:24
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 31 August 2015 14:38
|
 |
|
Re: Native DPI
By: mirek on Wed, 02 September 2015 16:11
|
 |
|
Re: Native DPI
By: Tom1 on Thu, 03 September 2015 09:07
|
 |
|
Re: Native DPI
By: mirek on Fri, 04 September 2015 08:51
|
 |
|
Re: Native DPI
By: Tom1 on Fri, 04 September 2015 10:10
|
 |
|
Re: Native DPI
By: mirek on Sun, 06 September 2015 07:35
|
 |
|
Re: Native DPI
By: Tom1 on Mon, 07 September 2015 10:55
|
 |
|
Re: Native DPI
By: mirek on Sun, 04 October 2015 08:07
|
Goto Forum:
Current Time: Tue Jul 01 20:03:42 CEST 2025
Total time taken to generate the page: 0.03977 seconds
|