![]() |
XAML not DPI Aware |
Post Reply ![]() |
Author | |
adrien ![]() Senior Member ![]() Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
![]() ![]() ![]() ![]() ![]() 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?
|
|
![]() |
|
adrien ![]() Senior Member ![]() Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
![]() ![]() ![]() ![]() ![]() |
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); |
|
![]() |
|
Fredrik ![]() Senior Member ![]() Joined: 22 June 2005 Status: Offline Points: 235 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
adrien ![]() Senior Member ![]() Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Fredrik ![]() Senior Member ![]() Joined: 22 June 2005 Status: Offline Points: 235 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
adrien ![]() Senior Member ![]() Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
![]() ![]() ![]() ![]() ![]() |
yes it's in the manifest (but only system DPI aware so far) Other things are scaling ok.
|
|
![]() |
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 |