get position *and time* of mouse path

  • Thread starter Thread starter Justin Carter
  • Start date Start date
J

Justin Carter

Hi. I am trying to save position and time data on users mouse
movements as they move between 2 targets. Saving the x-y position
data is not difficult using the AddLine method of a GraphicsPath
object. What I would love to do is make a new class inherited from
GraphicsPath and add time data to the AddLine method, but the
GraphicsPath class is sealed.

I am collecting this data for mouse clicks (MouseDown) using an
ArrayList holding a custom object consisting of Point and TimeSpan
variables. I could probably do the same thing for MouseMove with
GraphicsPath and TimeSpan, but am curious if anyone has any other
ideas.

Thanks,
Justin

(Oh, I'm using c#, but figured someone using vb might have done it.)
 
Justin,

You are pretty much going to have to do the same thing, storing the
TimeSpan information elsewhere outside of the GraphicsPath class.
Personally, I would have an ArrayList of your structures, with Point
information, and a time marker, not the timespan. The timespan can always
be computed. However, you can't move back from the timespan without storing
extra information.

Then, as you add your points, add the timespan as well. Basically, what
you mentioned before.

Hope this helps.
 
Hi Justin,

Do you actually use the GraphicsPath <as> a GraphicsPath later on or is it
just a handy place to put your co-ordinates?

If it's just for the storage then I'd certainly use the method that
Nicholas suggests. A GraphicsPath is a complex object which utilises Win
resources via the WinApi - overkill if you don't need that power.

Regards,
Fergus
 
* (e-mail address removed) (Justin Carter) scripsit:
movements as they move between 2 targets. Saving the x-y position
data is not difficult using the AddLine method of a GraphicsPath
object. What I would love to do is make a new class inherited from
GraphicsPath and add time data to the AddLine method, but the
GraphicsPath class is sealed.

I am collecting this data for mouse clicks (MouseDown) using an
ArrayList holding a custom object consisting of Point and TimeSpan
variables. I could probably do the same thing for MouseMove with
GraphicsPath and TimeSpan, but am curious if anyone has any other
ideas.

I think that's the best way. Store the "abstract" data in an arraylist
and convert it to a 'GraphicsPath'.
 
Back
Top