Print Page | Close Window

XAML not DPI Aware

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=23802
Printed Date: 11 December 2024 at 6:45pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: XAML not DPI Aware
Posted By: adrien
Subject: XAML not DPI Aware
Date Posted: 29 January 2019 at 7:35pm
Hi

how can we get XAML to use window scaling options / DPI aware functionality?

None of the font sizes or block or padding sizes are scaling, and they are all just specified as numbers in the XAML.

Please don't say we have to at runtime change the XAML to handle scaling.  That would make XAML unusable.

Maybe there's a switch or flag somewhere to enable it?


-------------
http://www.wingate.com - http://www.wingate.com



Replies:
Posted By: adrien
Date Posted: 29 January 2019 at 8:07pm
p.s. I tried the code as per below, but it did nothing.


CXTPMarkupContext* pContext = new CXTPMarkupContext();
pContext->SetDpiAware(TRUE);
pContext->SetDefaultTextSmoothing(TRUE);
pContext->SetDefaultSmoothingMode(xtpMarkupSmoothingAntiAlias);

CXTPMarkupDrawingContext dcMarkup(pContext, dcMem);




-------------
http://www.wingate.com - http://www.wingate.com


Posted By: Fredrik
Date Posted: 30 January 2019 at 3:34am
I use CXTPMarkupStatic and CXTPMarkupView, for the static I just call mStatic.GetMarkupContext()->SetDpiAware(TRUE); and it works fine. Font sizes I have in 'pt', e.g. FontSize='8pt'. 

-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0


Posted By: adrien
Date Posted: 30 January 2019 at 4:28am
what about borders, margins button widths etc?  Can you set them in pt as well?  I tried it briefly and it won't show anything at all now.

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: Fredrik
Date Posted: 30 January 2019 at 5:04am
No, borders, padding, margins, widths, heights I use pixels and that scales up on my 4K screen. What kind of control are you using? I got other problems with the markup control, but not so much regarding DPI. A long shot: does your manifest file specify your application is High DPI aware? 




-------------
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0


Posted By: adrien
Date Posted: 30 January 2019 at 2:22pm
yes it's in the manifest (but only system DPI aware so far)  Other things are scaling ok.

-------------
http://www.wingate.com - http://www.wingate.com



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