Results 1 to 10 of 10
Like Tree1Likes
  • 1 Post By Tolls

Thread: How to screen capture a running full screen DirectX program in Java?

  1. #1
    MEdiQueen is offline Member
    Join Date
    Sep 2012
    Posts
    4
    Rep Power
    0

    Default How to screen capture a running full screen DirectX program in Java?

    Hello,

    I have been trying several ways to capture a full screen DirectX program in java, namely using Robot library. Sadly all worked but not while the game/program was running in full screen.

    #i) First, I tried :
    Java Code:
    Robot robot = new Robot();
     GraphicsConfiguration config           = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
    final BufferedImage screenshot = robot.createScreenCapture(config.getBounds());
    ImageIO.write(screenshot,"png", file);
    Results:
    -> It works perfectly in no full screen mode
    -> in full screen it returns black picture


    #ii) Then I tried to press a key, since the game is providing some screenshot future, typing F6 on the keybord:
    Java Code:
    try {
                Robot bot = new Robot();
                bot.keyPress(KeyEvent.VK_F6);
                bot.delay(50);
                bot.keyRelease(KeyEvent.VK_F6);
            } catch (AWTException ex) {
                Logger.getLogger(main.class.getName()).log(Level.SEVERE, null, ex);
            }
    Results:
    -> No screenshot is saved. BUT when I type "by hand" the key F6, screenshot is taken by the game, as usual.


    #iii) I also tried to simulate IMPR SCR key.
    Results:
    -> Once again, it works perfectly when the game is not in full screen, but as soon as I run it in full screen, nothing is taken.


    I don't know what to do anymore...
    I have read some stuff about this, which may help me: javacv - Java interface to OpenCV and more - Google Project Hosting but I have no idea on how to approach this. If anybody could provide me some sample code working or if you could help me to find any clue for taking a screenshot of a directx full screen running program, I would be most grateful.
    Thank you for reading.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,412
    Rep Power
    25

    Default Re: How to screen capture a running full screen DirectX program in Java?

    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    MEdiQueen is offline Member
    Join Date
    Sep 2012
    Posts
    4
    Rep Power
    0

    Default Re: How to screen capture a running full screen DirectX program in Java?

    I don't know anything about Java forum and if they are active or not, so yes, I won't deny it, I tried on this one too.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,237
    Rep Power
    19

    Default Re: How to screen capture a running full screen DirectX program in Java?

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    MEdiQueen is offline Member
    Join Date
    Sep 2012
    Posts
    4
    Rep Power
    0

    Default Re: How to screen capture a running full screen DirectX program in Java?

    I am sad to see that I won't receive answer from anywhere because of this, and I wasn't even aware. I didn't know it could have such competition between different website.
    I don't know what to say, I am working on this since 3 days on this problem non stop and I was so annoyed to not find a valid solution that I posted like this hoping for an answer. But now I realise that all what I will get is nothing but "you posted the same question somewhere else".
    Sincerely sorry and sad, thank you anyway.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,009
    Rep Power
    20

    Default Re: How to screen capture a running full screen DirectX program in Java?

    It's not competition, it's about informing us (and the other sites) about where you've asked so we can see whether an answer had already been given.
    No point us duplicating effort, after all we're all volunteers and we do have our own stuff to do as well.

    Not that there's likely to be much duplication in this instance as it's a fairly narrow area of specialisation.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    MEdiQueen is offline Member
    Join Date
    Sep 2012
    Posts
    4
    Rep Power
    0

    Default Re: How to screen capture a running full screen DirectX program in Java?

    Quote Originally Posted by Tolls View Post
    It's not competition, it's about informing us (and the other sites) about where you've asked so we can see whether an answer had already been given.
    No point us duplicating effort, after all we're all volunteers and we do have our own stuff to do as well.

    Not that there's likely to be much duplication in this instance as it's a fairly narrow area of specialisation.
    In case I receive some answer/hint I will let you know anyway.

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,009
    Rep Power
    20

    Default Re: How to screen capture a running full screen DirectX program in Java?

    Thanks.
    It's one of the reasons for forums like this, as a resource that might come up via Google.

    Of course it's incredibly frustrating when you try and google a solution and all you get are lots of people asking the exact same question with no answers.
    :)
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,237
    Rep Power
    19

    Default Re: How to screen capture a running full screen DirectX program in Java?

    Quote Originally Posted by Tolls View Post
    Thanks.
    It's one of the reasons for forums like this, as a resource that might come up via Google.

    Of course it's incredibly frustrating when you try and google a solution and all you get are lots of people asking the exact same question with no answers.
    :)
    xkcd: Wisdom of the Ancients

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,009
    Rep Power
    20

    Default Re: How to screen capture a running full screen DirectX program in Java?

    Ah, xkcd, is there nothing in my life you haven't commented on already?
    :)
    DarrylBurke likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Capture the screen in java
    By PatriciaLopes in forum New To Java
    Replies: 3
    Last Post: 05-05-2012, 01:22 AM
  2. Screen Capture Recursion
    By Bestsanchez in forum New To Java
    Replies: 17
    Last Post: 03-18-2012, 09:04 PM
  3. Full Screen Image Viewer Java
    By kamirru in forum New To Java
    Replies: 11
    Last Post: 06-16-2011, 06:45 PM
  4. Automated screen capture app possible in Java?
    By leke in forum New To Java
    Replies: 1
    Last Post: 11-27-2010, 02:05 PM
  5. Full screen
    By Jack in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 05:49 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
  •