Strane gaze points on different screen

Forum for C#/Windows development

Strane gaze points on different screen

Postby venom1988 » 11 Mar 2016, 11:15

Dear all,
I recently develop a little and simple WPF application with a Canvas and an Ellipse. Basically I want move the ellipse in function of the gaze points (x;y). This is my code:

Code: Select all
public void OnGazeUpdate(GazeData gazeData)
        {
            if (GazeManager.Instance.IsCalibrated)
            {
               

                double gXs =gazeData.SmoothedCoordinates.X;
                double gYs =gazeData.SmoothedCoordinates.Y;
                Dispatcher.Invoke(() =>
                {
                    Canvas.SetLeft(ellisse, gXs);
                    Canvas.SetTop(ellisse, gYs); ;
                });
            }
        }


On my PC this code work fine and I have very good Gaze Point driving the ellipse. (display resolution 1280 x 1024). When I install my app on another PC with better screen resolution (I think 4K ) the gaze points (and the ellipse) are not good, the position of the ellipse is drastically different from the point that the user is watching.

What is the problem? Is the display resolution?

Thank you.
venom1988
 
Posts: 12
Joined: 07 Dec 2015, 16:21

Re: Strane gaze points on different screen

Postby Martin » 12 Mar 2016, 02:16

Sounds like a DPI scaling issue. I use it on my 4K display to make text on icons readable which otherwise are way too small.

Try multiplying coordinates of the ellipse position with DPI scale factor. We have some code for accessing DPI on Github.
Martin
 
Posts: 567
Joined: 29 Oct 2013, 15:20


Return to C#



cron