Solved

Mouse cursor capture

Posted on 2008-06-19
5
1,228 Views
Last Modified: 2013-11-23
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
Comment
Question by:sameerz786
  • 3
5 Comments
 
LVL 9

Expert Comment

by:mbodewes
ID: 21850702
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
 
LVL 12

Accepted Solution

by:
trinitrotoluene earned 500 total points
ID: 21858428
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
 
LVL 12

Expert Comment

by:trinitrotoluene
ID: 21858483
just in case you need this documentation for reference:

http://java.sun.com/javase/6/docs/api/java/awt/Robot.html
0
 
LVL 12

Expert Comment

by:trinitrotoluene
ID: 21869258
have u tried this out?
0
 

Author Closing Comment

by:sameerz786
ID: 31468697
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question