title: How to get the touch coordinates of sub-pixel accuracy in Windows?
body: <p>My purpose is to get touch input with a higher accuracy than pixel coordinates.</p>
  
  <p>I am getting touch coordinates in a WM_TOUCH handler using GetTouchInputInfo function. After calling this function, I get a TOUCHINPUT structure variable in which includes two members: x and y. These two members are indicated in hundredths of a pixel of physical screen coordinates. For instance, if I got x = 11234, y = 42367, the corresponding physical screen coordinates would be (112.34, 423.67) </p>
  
  <p>According to above I can get coordinates with accuracy of 2 decimal, that's great. The problem is that the value I got from the TOUCHINPUT structure are all like: x=11200 y=42300. So I can only get integer accuracy pixel coordinates (112, 423).</p>
  
  <p>Windows provided a marco <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd744778(v=vs.85).aspx" rel="nofollow noreferrer">TOUCH_COORD_TO_PIXEL</a>.</p>
  
  <pre><code>#define TOUCH_COORD_TO_PIXEL(l)         ((l) / 100)
  </code></pre>
  
  <p>This is just a simple conversion from touch input coordinates to integer pixel coordinates. 
  The interesting part is in the remarks: The TOUCH_COORD_TO_PIXEL macro is used to convert from touch coordinates (currently centipixels) to pixels. Touch coordinates are finer grained than pixels so that application developers can use subpixel granularity for specialized applications such as graphic design.</p>
  
  <p>This means that normally touch coordinates are more accurate.</p>
  
  <p>I asked a <a href="https://stackoverflow.com/questions/38710219/is-it-possible-to-obtain-float-touch-coordinates-in-windows">question</a> before, I thought I could only get integer touch coordinates at that time. stark said I got 11200 because of my touch sensor accuracy. I searched a lot, and I find that they get data from touch area and use sub-pixel interpolation to decide the peak. So the peak should be a flout value even the touch is not accurate. Furthermore，I'm using surface pro 4 which has the latest G5 touch controller, and I think that should be accurate enough as it is the representative product from Microsoft. I also tried 2 other touch monitors, same problem.</p>
  
  <p>Hence I think there are some setting problems because of using wrong parameters. If it is the accurate problem, can you explain me why?</p>
  
  <p>Thank you very much!  </p>