Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1233
  • Last Modified:

Mouse cursor capture

Does any body have screen canpture code in java (JNI) which captures the mouse cursor too?
i have tried Robot but that doesn't capture mouse cursor
0
sameerz786
Asked:
sameerz786
  • 3
1 Solution
 
mbodewesCommented:
I don't have a solution, but you are better off asking the question in one of the Windows or Linux groups. You can always write Java code around any c/c++ code they can offer.

Note that the cursor is almost always hardware accelerated. It's not something that is part of the drawing of the windows or desktop at all. So the code has to be pretty explicit to include it.
0
 
trinitrotolueneCommented:
Robot does not do screen captures which include the mouse pointer.

One possible solution could be for you to implement a native method which draws the mouse cursor on the screen capture image using the mouse coordinates.

Get the mouse coordinates through a Cursor object.
Supply these coordinates to the native method and then call this native method from your Java code.

Let me see whether there is any other way to do the same....in the meantime can you try this approach I've suggested


0
 
trinitrotolueneCommented:
just in case you need this documentation for reference:

http://java.sun.com/javase/6/docs/api/java/awt/Robot.html
0
 
trinitrotolueneCommented:
have u tried this out?
0
 
sameerz786Author Commented:
Thanx i was trying to find the mouse cursor capturing method darwing it on the mouse coordinates was my last option i.e if no other way out is there, thanx for help
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now