Windows 8 screen coordinates and the EyeTribe Server
Posted: 14 Mar 2014, 09:53
Windows 8 tablet.
It has physical resolution 1920x1080, but logically 1.25 times less: 1536x864
When you ask the TET server about the screen:
..it returns 1536x864. You expect frames to contain coordinates in [0..1535, 0..863] range.
But when it sends frames, they have values with physical resolution! You may get X coordinate like 1900 or more.
Surprisingly the "EyeTribe UI" understatnds (somehow) thet the coordinates recieved should be corrected, and places the cursor in the right position.
In my opinion this TET server's behavior is incorrect. It should return values according to "screenresw", "screenresh".
So far I had to do the following:
note: probably it was windows 8.1, not pure 8. Not sure now, already returned the tablet to the owner.
It has physical resolution 1920x1080, but logically 1.25 times less: 1536x864
When you ask the TET server about the screen:
- Code: Select all
{
"category": "tracker",
"request" : "get",
"values": [ "screenresw", "screenresh" ]
}
..it returns 1536x864. You expect frames to contain coordinates in [0..1535, 0..863] range.
But when it sends frames, they have values with physical resolution! You may get X coordinate like 1900 or more.
Surprisingly the "EyeTribe UI" understatnds (somehow) thet the coordinates recieved should be corrected, and places the cursor in the right position.
In my opinion this TET server's behavior is incorrect. It should return values according to "screenresw", "screenresh".
So far I had to do the following:
- Code: Select all
// Get "virtual screen resolution
screenX=GetSystemMetrics(SM_CXSCREEN);
screenY=GetSystemMetrics(SM_CYSCREEN);
// Get physical resolution
DEVMODE dm;
ZeroMemory (&dm, sizeof (dm));
EnumDisplaySettings (NULL, ENUM_CURRENT_SETTINGS, &dm);
// correct the mouse pointer position using the scale:
screen_scale=((double)screenX)/dm.dmPelsWidth;
note: probably it was windows 8.1, not pure 8. Not sure now, already returned the tablet to the owner.