|
| | |||||||
| Tablet PC Developers Show off your work while discussing with others how to create ink enabled applications. |
| | LinkBack | Thread Tools |
| |||
| Absolut Coordinates Hi, I am currently working on a project where we need to be able to get the absolute coordinates of the the pen on the digitizer (preferably in centimeters). I have tried to use RealTimeStylus by implementing the IStylusSyncPlugin interface and reading the PacketsData but this seems to only contain the position of the cursor relative to the current window (Form). So my question is what is the best way of getting the absolute position of the pen on the digitizer? Any help or pointers would be much appreciated. /Andreas |
| |||
| Re: Absolut Coordinates Well 1) if its acceptable that the coordinates are only reported when the stylus is over your window, you can always convert the relative coordinates to screen coordinates by using standard translation methods such as PointToScreen. For example, you can do: Point origin = myWindow.PointToScreen(new Point(0,0)); myRenderer.PixelToInkSpace(myGraphics, ref origin); // Now the origin variable contains a point in inkspace coordinates // that represents the upper-left of the window's client area // So you can get the absolute position of the cursor by adding this to // the relative coordinate you get from RealTimeStylus. Point screenCoords = origin; screenCoords.Offset(relativeCoords); 2) If you don't need the accuracy of the digitizer (which has a much higher resolution than pixels) you can install a low-level mouse hook, and convert the screen pixel coordinates to ink space using the same mechanism above. I wrote an article about how to do this but to my knowledge it has not been posted on MSDN so I can't even link to it. 3) You can access the HID stream directly but I have no idea how to do this or even where to begin and it's quite a chore from what I understand. -- Josh Einstein (Tablet PC MVP) Einstein Technologies Tablet Enhancements for Outlook - Try it free: www.tabletoutlook.com "AndreasL" <andreas.lindmark@capab.se> wrote in message news:AndreasL.2sxidj@no-mx.tabletquestions.com... > > Hi, > > I am currently working on a project where we need to be able to get the > absolute coordinates of the the pen on the digitizer (preferably in > centimeters). > I have tried to use RealTimeStylus by implementing the > IStylusSyncPlugin interface and reading the PacketsData but this seems > to only contain the position of the cursor relative to the current > window (Form). > > So my question is what is the best way of getting the absolute position > of the pen on the digitizer? > > > Any help or pointers would be much appreciated. > > /Andreas > > > -- > AndreasL |
| |||
| Re: Absolut Coordinates It seems like I have to go with option number 3. The HID stream. I haven't found any information on how to do this with a tablet, but if I get any results I'll try to post them here. Thanks for the help. Quote:
|
| Bookmarks |
| Thread Tools | |
| |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |