PDA

View Full Version : Ballpen distance traveled



sztagan
15th July 2012, 12:24
Hello,

I'm just developing application for medical tests with graphic tablet. My tablet works just fine (I receive events, and handle it). But I'm struggle with two dilemmas:

1. Is there any way to measure distance traveled by pen on tablet during drawing? With mouse I can do this quite easily using screen resolution information and some math. But with tablet I don't have information about it's resolution and real number on pixels that a pen traveled (informations from

hiResGlobalPos are after some transformations).

2. I need my event receive in equal time interval, say 10 miliseconds, this is because I perform FFT on it. Does anyone has some simple idea for that?

I will be very thankful if someone help me with this

best regards
Paweł

ChrisW67
16th July 2012, 01:00
Without the physical dimensions and x/y range of the tablet I do not see how you can determine the physical distance on the tablet. If you had some rudimentary, on-time calibration process you could determine this information. Something like:

Ask the user to supply the dimensions of the stylus area
Determine the x and y coordinates when the stylus is on the top left corner of the tablet.
Determine the x and y coordinates when the stylus is on the lower right corner of the tablet.
Calculate the x and y units per millimetre etc.

Another approach might be to ask the user (once) to draw a 50 millimetre line along the diagonal using a ruler and stylus, or draw the whole diagonal and supply its length.