How to capture screen image with mouse pointer on it in Java? In know that i can capture screen with Robot class, but it captures screen without mouse pointer on it, so this is not an solution for me.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s not directly possible, but you can use
MouseInfo#getPointerInfo()to get information where the pointer is currently located.After getting the screenshot as
BufferedImage, you can place your own cursor image at exactly that location on the screenshot with help of Java 2D API.