Results 1 to 3 of 3
  1. #1
    sagngh8 is offline Member
    Join Date
    Nov 2010
    Posts
    6
    Rep Power
    0

    Default Taking screenshot using java robot class not woring when pc is locked.

    Hi Everyone,

    I have implemented robot to take the screenshot of the desktop.

    Robot objRobot = null;
    try
    {
    objRobot = new Robot();
    } catch(Exception ex)
    {

    }
    BufferedImage objBufferedImage = objRobot.createScreenCapture(objRectArea);


    The problem with robot is when my computer is locked the image comes as black.That is what is displayed in the desktop is not
    captured.I need the screenshot of what is displayed in the desktop even when my computer is locked.Please suggest me any ideas.
    It would be better if it is still possible to do it using robot.


    Thanks Regards,
    Sagar.

  2. #2
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    5

    Default

    I'm pretty sure it's impossible. The reason I say this is because, at least for Windows, the objects are not rendered when the computer is hibernating, sleeping, logged out, or locked. Thus, when taking a screen capture, you will only ever capture black.

    You will notice that, when you log into or unlock a Windows computer, the screen will show as the screen you logged out from for a single frame, then re-render as what it should be, because nothing was rendered in between.

    This might be possible in C++ though a Windows API, but Java does not support such things.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

Similar Threads

  1. Replies: 3
    Last Post: 05-03-2011, 03:24 AM
  2. Help with Robot class please
    By davetheant in forum New To Java
    Replies: 2
    Last Post: 01-04-2011, 12:13 PM
  3. Robot class
    By coltragon in forum New To Java
    Replies: 6
    Last Post: 07-12-2010, 05:54 PM
  4. Help with Robot Class
    By protocos in forum Eclipse
    Replies: 11
    Last Post: 10-05-2009, 08:15 PM
  5. Help with Java Robot and Runtime Class
    By Rmond1254 in forum New To Java
    Replies: 1
    Last Post: 02-18-2009, 06:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •