Home › Forums › Software Development › Display scaling with new coresdk
- This topic has 4 replies, 3 voices, and was last updated 5 years, 9 months ago by Anonymous.
- 14/06/2017 at 20:23 #7036AnonymousInactive
Hi 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 #7037AnonymousInactive
I 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]Keymaster
Hi @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]Participant
Why don’t you just call SetProcessDpiAware() yourself?19/06/2017 at 23:09 #7068AnonymousInactive
@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.
- You must be logged in to reply to this topic.