High-DPI 4k resolution - Automatic scaling |
Post Reply |
Author | |
g_j_a_i_n
Groupie Joined: 27 August 2005 Status: Offline Points: 94 |
Post Options
Thanks(0)
Posted: 15 September 2016 at 6:33am |
I just upgraded to v17.2 mainly for the High-DPI support. I want to know that if I just build with the new version, with my app automatically scale on High-DPI resolution (4k resolution) ? Or should I write some code to enable it? I am using Tab control, report view control, toolbars and menu bars with 16x16 icons. So will these 16x16 icons scale automatically? I don't mind if they are blurred initially. Also, if my image list contains 32x32 icons or 128x128 icons, will the frame work use them automatically when scaling up? Please this is urgent. Regards, Gautam Jain |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello Gautam Jain,
Tab control and report control don't support DPI scaling. Toolbars and menu bars are support choosing icons with appropriate size (if icon has several sizes in one file), but unfortunately with some bugs. We are working on this now. Regards, Oleksandr Lebed |
|
g_j_a_i_n
Groupie Joined: 27 August 2005 Status: Offline Points: 94 |
Post Options
Thanks(0)
|
Thanks @olebed for the information.
So I will have to do some coding for tab control and report control. Can you tell me what is the correct way to detect if the user is having High-DPI or not? How do I decide when to use an icon of higher resolution? Are there any XTP or Windows functions for that? Regards, Gautam Jain
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
> to detect if the user is having High-DPI or not
use our drawing helper class CXTPDpi (or global XTPDpiHelper() ) call XTPDpiHelper()->GetDPIX() or XTPDpiHelper()->GetDPIY() to obtains horizontal and vertical DPI values for the system, device context or window handle. >How do I decide when to use an icon of higher resolution? Library should make it automatically - size of icon is chosen for available space in ToolBar or Ribbon. Also some options in CommandBars are taken into account and can affect to size of bars/buttons/icons. |
|
g_j_a_i_n
Groupie Joined: 27 August 2005 Status: Offline Points: 94 |
Post Options
Thanks(0)
|
Fantastic! Thanks :)
|
|
g_j_a_i_n
Groupie Joined: 27 August 2005 Status: Offline Points: 94 |
Post Options
Thanks(0)
|
When can we expect a fix. In how many weeks? Will it be in 17.3?
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
I'm not sure about v17.3. Fix need many changes which should be very neat. The same code used for drawing controls on all commandBars, ribbon. Also many themes should be tested. The same code supports very old features near new. So we need to care all of them.
|
|
g_j_a_i_n
Groupie Joined: 27 August 2005 Status: Offline Points: 94 |
Post Options
Thanks(0)
|
Hello @Olebed, Now that 17.3 is released can you tell me if: 1. The menu bar will be automatically scaled on 4k display? The text and icon 2. What if the icon is only 16x16, will the menu bar still be scaled? 3. Same question 1 and 2 for toolbars also 4. Same question 1 for Report control header also 5. In order to detect 4k display what is the minimum resolution you check or minimum DPI? Sorry, I don't have a 4k monitor yet. So cannot test it myself. Thanks for your help.
|
|
g_j_a_i_n
Groupie Joined: 27 August 2005 Status: Offline Points: 94 |
Post Options
Thanks(0)
|
In addition to above questions, also tell me about status bar scaling.
Thanks.
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
questions 1-3. Size of toolbars, menubars and other command bars and their text and icons are depend on system DPI. For 100% DPI (96 dpi) its height is 25px.
200% (192 dpi) -> 50px, 300% (288 dpi) -> 75px and so on. question 2. Yes, if the icon is only 16x16, then the menu bar still be scaled.
question 4. ReportControl don't support High DPI scaling. Size of elements depend on size of font and can be changed by developer. question 5. User can set any available DPI on 4k display. That is why we take into account only system DPI settings. I see many question about size of icons in CommandBars (also in Ribbon, ToolBar, MenuBar) so I have described detail it there.
StatusBar is scaled according to system DPI. |
|
g_j_a_i_n
Groupie Joined: 27 August 2005 Status: Offline Points: 94 |
Post Options
Thanks(0)
|
Great! Thanks for the detailed help. Wish you the best! Regards, Gautam Jain
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |