Print Page | Close Window

High-DPI 4k resolution - Automatic scaling

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=23134
Printed Date: 04 October 2024 at 11:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: High-DPI 4k resolution - Automatic scaling
Posted By: g_j_a_i_n
Subject: High-DPI 4k resolution - Automatic scaling
Date Posted: 15 September 2016 at 6:33am

Hello,

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




Replies:
Posted By: olebed
Date Posted: 15 September 2016 at 2:52pm
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


Posted By: g_j_a_i_n
Date Posted: 16 September 2016 at 3:00am
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


Posted By: olebed
Date Posted: 16 September 2016 at 3:31am
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.


Posted By: g_j_a_i_n
Date Posted: 17 September 2016 at 1:36am
Fantastic! Thanks :)


Posted By: g_j_a_i_n
Date Posted: 17 September 2016 at 1:52am

When can we expect a fix. In how many weeks?

Will it be in 17.3?


Posted By: olebed
Date Posted: 17 September 2016 at 1:55am
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.


Posted By: g_j_a_i_n
Date Posted: 04 November 2016 at 7:25am
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.


Posted By: g_j_a_i_n
Date Posted: 04 November 2016 at 10:57am
In addition to above questions, also tell me about status bar scaling.

Thanks.


Posted By: olebed
Date Posted: 08 November 2016 at 1:43pm
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 http://forum.codejock.com/forum_posts.asp?TID=23038&PID=75291&title=dpi#75291" rel="nofollow - there .

Originally posted by g_j_a_i_n g_j_a_i_n wrote:

In addition to above questions, also tell me about status bar scaling.

StatusBar is scaled according to system DPI.


Posted By: g_j_a_i_n
Date Posted: 09 November 2016 at 12:30am
Great! Thanks for the detailed help.

Wish you the best!

Regards,
Gautam Jain



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net