Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - XAML not DPI Aware
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

XAML not DPI Aware

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: XAML not DPI Aware
    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?
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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);


Back to Top
Fredrik View Drop Down
Senior Member
Senior Member


Joined: 22 June 2005
Status: Offline
Points: 235
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fredrik Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Fredrik View Drop Down
Senior Member
Senior Member


Joined: 22 June 2005
Status: Offline
Points: 235
Post Options Post Options   Thanks (0) Thanks(0)   Quote Fredrik Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.180 seconds.