Home › Forums › Software Development › Display scaling with new coresdk
- This topic has 4 replies, 3 voices, and was last updated 6 years, 3 months ago by
Anonymous.
- AuthorPosts
- 14/06/2017 at 20:23 #7036
Anonymous
InactiveHi I have an application that was built on an old Tobii windows forms example application which was using the old EyeX framework. I recently tried to update it to the new core SDK. However, now I notice that the point on the screen appears to be offset the more I look to the lower right-hand corner. Based on previous post in the forum, it seems this is due to the display scaling issue. My DPI is set to 125% and I wish to keep it there.
Is it possible that the old SDK adjusted for display scaling and the new SDK does not? Specifically, I’m guessing adjustments might be in the old forms host. Is there anyway you can add support for display scaling in the new SDK, or do I have to account for it manually now?
14/06/2017 at 21:03 #7037Anonymous
InactiveI think I found a solution. Since FormsEyeXHost is deprecated, and this object called SetProcessDpiAware(), we have to find another way to call it. Even though I’m running a Windows forms application, I called InitializeWpfAgent hoping it would call SetProcessDpiAware. It appears that it does and it works.
To fix the problem, just add this to your code:
_eyeXHost.InitializeWpfAgent();
15/06/2017 at 16:32 #7047Grant [Tobii]
KeymasterHi @phylaxer, great thanks for the tip and glad you managed to find a solution for your needs.
16/06/2017 at 15:20 #7059Alex [Tobii]
ParticipantHi!
Why don’t you just call SetProcessDpiAware() yourself?
19/06/2017 at 23:09 #7068Anonymous
Inactive@alex I was guessing that that was the function being called. I’m not actually sure what happens inside the FormsEyeXHost or InitializeWpfAgent() call since it’s not open source. I didn’t want to miss something important and preferred an easy and official way to do it.
- AuthorPosts
- You must be logged in to reply to this topic.