<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://theeyetribe.com/forum/feed.php?f=27&amp;t=140" />

<title>The Eye Tribe</title>
<subtitle>Developer Forum</subtitle>
<link href="http://theeyetribe.com/forum/index.php" />
<updated>2014-03-14T14:59:53+02:00</updated>

<author><name><![CDATA[The Eye Tribe]]></name></author>
<id>http://theeyetribe.com/forum/feed.php?f=27&amp;t=140</id>
<entry>
<author><name><![CDATA[MastaLomaster]]></name></author>
<updated>2014-03-14T14:59:53+02:00</updated>
<published>2014-03-14T14:59:53+02:00</published>
<id>http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=564#p564</id>
<link href="http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=564#p564"/>
<title type="html"><![CDATA[Re: Windows 8 screen coordinates and the EyeTribe Server]]></title>

<content type="html" xml:base="http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=564#p564"><![CDATA[
What I'm talking about is that &quot;<span style="font-weight: bold">screenresw</span>&quot; and &quot;<span style="font-weight: bold">screenresh</span>&quot; are absolutely <span style="font-weight: bold">USELESS</span> now.<br /><br />They <span style="font-weight: bold">COULD</span> help if they return the range of coordinates returned by the server. I.e. if  <span style="font-weight: bold">screenresw</span> returns 1920, then the application knows that gazeData.SmoothedCoordinates.X==1919 means 100% screen width.<br /><br />In fact, currently there is no reason to ask the server for these values. Anyway you have to decrypt the X and Y values yourself, based on your own understanding of DPI.<p>Statistics: Posted by <a href="http://theeyetribe.com/forum/memberlist.php?mode=viewprofile&amp;u=2722">skataMastaLomaster</a> — 14 Mar 2014, 14:59</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Martin]]></name></author>
<updated>2014-03-14T14:37:12+02:00</updated>
<published>2014-03-14T14:37:12+02:00</published>
<id>http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=563#p563</id>
<link href="http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=563#p563"/>
<title type="html"><![CDATA[Re: Windows 8 screen coordinates and the EyeTribe Server]]></title>

<content type="html" xml:base="http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=563#p563"><![CDATA[
Correct, this issue is related to DPI scaling which needs to be handled in the application logic. <br /><br />Our method of handling it uses a transformation matrix, like this:<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>public void OnGazeUpdate(GazeData gazeData)<br />{<br />    int x = (int)gazeData.SmoothedCoordinates.X;<br />    int y = (int)gazeData.SmoothedCoordinates.Y;<br />    Screen winScreen = Screen.FromHandle(new WindowInteropHelper(this).Handle);<br /><br />    Matrix transfrm = GetTransformationMatrix();<br />    double screenX = (int)Math.Round((double)x + winScreen.Bounds.Left, 0);<br />    double screenY = (int)Math.Round((double)y + winScreen.Bounds.Top, 0);<br />    Point pt = new Point(screenX, screenY);<br />    pt = transfrm.Transform(pt);<br />}<br /></code></dd></dl><br /><br />And the code for the GetTransformationMatrix() method:<br /><dl class="codebox"><dt>Code: </dt><dd><code>private Matrix GetTransformationMatrix()<br />{<br />     var transMatrix = new Matrix();<br />     var presentationSource = PresentationSource.FromVisual(this);<br /><br />     if (presentationSource == null) <br />          return transMatrix;<br /><br />     if (presentationSource.CompositionTarget == null) <br />          return transMatrix;<br /><br />     return presentationSource.CompositionTarget.TransformFromDevice;<br />}<br /></code></dd></dl><p>Statistics: Posted by <a href="http://theeyetribe.com/forum/memberlist.php?mode=viewprofile&amp;u=117">skataMartin</a> — 14 Mar 2014, 14:37</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[MastaLomaster]]></name></author>
<updated>2014-03-14T09:53:57+02:00</updated>
<published>2014-03-14T09:53:57+02:00</published>
<id>http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=562#p562</id>
<link href="http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=562#p562"/>
<title type="html"><![CDATA[Windows 8 screen coordinates and the EyeTribe Server]]></title>

<content type="html" xml:base="http://theeyetribe.com/forum/viewtopic.php?t=140&amp;p=562#p562"><![CDATA[
Windows 8 tablet.<br />It has physical resolution 1920x1080, but logically 1.25 times less: 1536x864<br /><br />When you ask the TET server about the screen:<br /><dl class="codebox"><dt>Code: </dt><dd><code>{<br />    &quot;category&quot;: &quot;tracker&quot;,<br />    &quot;request&quot; : &quot;get&quot;,<br />    &quot;values&quot;: &#91; &quot;screenresw&quot;, &quot;screenresh&quot; &#93;<br />}<br /></code></dd></dl><br />..it returns 1536x864. You expect frames to contain coordinates in [0..1535, 0..863] range.<br /><br />But when it sends frames, they have values with physical resolution! You may get X coordinate like 1900 or more.<br /><br />Surprisingly the &quot;EyeTribe UI&quot; understatnds (somehow) thet the coordinates recieved should be corrected, and places the cursor in the right position.<br /><br />In my opinion this TET server's behavior is incorrect. It should return values according to &quot;screenresw&quot;, &quot;screenresh&quot;.<br /><br />So far I had to do the following:<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>              // Get &quot;virtual screen resolution<br />   screenX=GetSystemMetrics(SM_CXSCREEN);<br />   screenY=GetSystemMetrics(SM_CYSCREEN);<br /><br />   // Get physical resolution<br />   DEVMODE dm;<br />   ZeroMemory (&amp;dm, sizeof (dm));<br />   EnumDisplaySettings (NULL, ENUM_CURRENT_SETTINGS, &amp;dm);<br /><br />              // correct the mouse pointer position using the scale:<br />   screen_scale=((double)screenX)/dm.dmPelsWidth;<br /></code></dd></dl><br /><br /><span style="font-weight: bold">note:</span> probably it was windows 8.1, not pure 8. Not sure now, already returned the tablet to the owner.<p>Statistics: Posted by <a href="http://theeyetribe.com/forum/memberlist.php?mode=viewprofile&amp;u=2722">skataMastaLomaster</a> — 14 Mar 2014, 09:53</p><hr />
]]></content>
</entry>
</feed>