To get more in depth information about the usage of WinForm or Webapplications I want to capture mouse-movement and click information. It would be perfect if this could be rendered to an image.
The result would be something like this:
Google: capture display "mouse movement" app to image
The question is how does one start with creating an app like this?
- How do I receive mousemovements and clicks when its a process from another application?
- How convert mousemovements to an image?
(Anyone know if there is a opensource of free/cheap app which can do this)
IOGraphica is able to do this, but it is in Java and it is free, but not open source.
-
1It'd be interesting to render this over a screenshot of the application aswell.BenCr– BenCr2011年03月03日 14:24:59 +00:00Commented Mar 3, 2011 at 14:24
-
Indeed, will also add a capture as background.Ralf de Kleine– Ralf de Kleine2011年03月25日 13:29:20 +00:00Commented Mar 25, 2011 at 13:29
2 Answers 2
I would try to capture any mouse movement/click of your windows and store it in a collection. When you finished recording - try to draw your image. I would recommend looking for "c# capture mouse" or "mouse hook" in google. Some time ago I did this for getting a keyboard hook. You may have a look at Processing Global Mouse Events.
In terms of code this may help:
Dictionary<Point, MouseEventInfo> dict = new Dictionary<Point, MouseEventInfo>();
/// see given link to find the correct way to get this kind of event
public void mouse_event(....)
{
/// get mouse coordinates
/// create point struct
/// check if point exists in DICT
/// no - add new MouseEventInfo at Point
/// yes - access MouseEventInfo object and increase a value according to the event
}
public void onFinished()
{
/// create new bitmap/image - width/height according to your screen resultion
/// iterate through all MouseEventInfo objects and draw any information
}
/// stores mouse event info for a point
class MouseEventInfo
{
Point p;
int moved=0;
int clicked=0;
int doubleClicked=0;
}
I know this is just a piece of pseudoCode - anyway - I hope this may help you! Ah - keep in mind that any kind of hook (keyboard, mouse or anything else) may result in a virus alert of your antiVir.
hth
Comments
If you're looking for something which you could run externally and track mouse movement and clicks, you might find this mouse/keyboard hooking project over at codeproject.com useful:
http://www.codeproject.com/KB/system/globalmousekeyboardlib.aspx
There's a sample application and a hooking lib with full source. It'd be a starting point to use in your efforts.