Robot.createScreenCapture() is capturing the hidden frames also.

Hi All,
I am providing a full screen capture facility of desktop through a button present inside a JFrame (mainFrame). Whenever user clicks on the button, I am hiding the mainFrame (containing the button) and then doing a full screen capture of the desktop using robot.createScreenCapture() method. Once the screen is captured, I am showing that screen in a separate JFrame which is undecorated and is of full screen size.
My problem is, when I am capturing the desktop, I am getting the mainFrame also inside that capture image even I am hiding it before calling capture method. Sometimes, the mainFrame is getting captured with all components inside it and sometimes, just empty frame. This is happening only on Windows and Linux system. On MAC, same code is working fine.
I tried by calling sleep() method on current thread, by disposing the mainFrame once the button is clicked etc but in vain.
Can anybody provide me the way to overcome this issue? I need to capture only the desktop.
Thanks in advance.
Regards,
VPKVL

Where is your SSCCE?Hi camickr,
Thanks for your quick reply. I prepared SSCCE in similar lines as my actual application, but to my surprise, I am not getting that issue on that. But its still reproducible within my main application. I am using JDK5. Will provide the sample application once I am able to reproduce the issue in that.

Similar Messages

  • Unable to capture a video using robot.createScreenCapture

    Hi all,
    I'm having one problem with robot.createScreenCapture, i used the
    below code to take screen shot, everything goes fine except one case, I'm unable to capture videos played in windows media player & winamp, black screen is displaying instead of the video. I used avi files.
    here is the code
    import java.awt.AWTException;
    import java.awt.Dimension;
    import java.awt.Image;
    import java.awt.Rectangle;
    import java.awt.Robot;
    import java.awt.Toolkit;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class CaptureImage implements ActionListener {
         Robot robot = new Robot();
         Image image = null;
         public CaptureImage() throws AWTException {
              JFrame frame = new JFrame("Capture");
              JButton button = new JButton("Capture");
              frame.setAlwaysOnTop(true);
              button.addActionListener(this);
              frame.getContentPane().add(button);
              frame.pack();
              frame.setVisible(true);
         public void actionPerformed(ActionEvent e) {
              // image = robot.createScreenCapture(new Rectangle(800, 600));
              String outFileName = "shot.png";
              // determine current screen size
              Toolkit toolkit = Toolkit.getDefaultToolkit();
              Dimension screenSize = toolkit.getScreenSize();
              Rectangle screenRect = new Rectangle(screenSize);
              // create screen shot
              Robot robot;
              try {
                   robot = new Robot();
                   BufferedImage image = robot.createScreenCapture(screenRect);
                   ImageIO.write(image, "png", new File(outFileName));
                   System.out.println("Saved screen shot (" + image.getWidth() + " x "
                             + image.getHeight() + " pixels) to file \"" + outFileName
                             + "\".");
              } catch (IOException e2) {
                   e2.printStackTrace();
              } catch (AWTException e1) {
                   e1.printStackTrace();
         public static void main(String[] args) {
              try {
                   new CaptureImage();
              } catch (AWTException e) {
                   e.printStackTrace();
    }

    Are you setting the videoPause property to true in the rule you're using to navigate to the video screen? For example, assume you're using a button to navigate to the VideoScreen, its OnSelect property should be: Navigate(VideoScreen, ScreenTransition!Fade,{videoPause:false}).
    Basically, the value needs to change for the video to pause. If you don't have that set up, you could also do that within the rule you're using to navigate to scrHome as follows:  
    UpdateContext({videoPause: false});Navigate(scrHome, ScreenTransition!Fade,{videoPause: true})
    Thanks
    Robin

  • How to identify the hidden columns in table by using af:panelCollection

    Hi,
    We are using af:panelCollection tag for a table to show personalization features. i.e. to hide or disaply colums in the table.
    We also have a print button to print data in the table. the issue is when we hide any column in teble using the personalization feature given by af:panelCollection , we can see the hidden columns also on the page to be printed.which should not happen.
    For printing table we cant use showPrintablePageBehavior coz it prints data on current page only where as we also have Print all data button which should print all data on table which is not visible on scrren due to pagination.
    Using ADF 11.1.1.5.0 and JSF 2.0 . Please help how to capture whci colums are made hidden.
    The code used for printing data is
    <div class="print_data">Print Current Data</div>
    <ahref="printCurrentData.jsp" target="_blank" class="left">
    <img src="print.png" alt="abc"
    width="24" height="22" border="0"/></a>
    <div class="print_data">Print All Data</div>
    <ahref="printAllData.jsp" target="_blank" class="left">
    <img src="print.png" alt="abc"/></a>
    Edited by: 924834 on Aug 27, 2012 4:27 AM
    Edited by: 924834 on Aug 27, 2012 4:28 AM

    There are some things which don't add up here.
    You are using jdev 11.1.1.5.0 which only comes with jsf 1.2, but you are using jsf 2.0?
    Then you are using jsp instead of jsf which are the normal way to go for jsf.
    Can you please clarify on this?
    How is the printCurrentData.jsp setup? Do you have a table on it based on the same iterator as on the visible page with the hidden column?
    Timo

  • When I capture a still frame froma video in Llightroom 4.3, where does the captured frame end up?

    When I capture a still frame froma video in Llightroom 4.3, where does the captured frame end up? I cannot find it. Stan

    It will be right next to the movie in your library and the jpg file will end up on your hard disk right next to the movie file. You can see the actual file by right (or control) clicking on the image in the library view and selecting "show in Finder/Explorer"

  • Pullout sidebar help!  When hidden the scrollable frame blocks interactive content beneath it.

    Ok, I feel like this is one of those things that has a really easy answer and I'm just missing it but I have been kicking it around for a few weeks and can't come up with anything.
    Really basic problem:  I have a pull out sidebar for my app as a scrollable frame and it works fine.  It is the top layer of course because it has to always be available from any part of the app. 
    The issue, as I said in the title, is that even when the sidebar is hidden and you can only see the pullout tab, the entire scrollable frame is still invisibly blocking all interactive content beneath it.  So for example any buttons on that side of the app arent clickable, no video controlls, etc etc.  Anytime you click on that side of the app it thinks you are trying to manipulate the scroll frame.
    I don't know what to do!
    Thank you for any ideas.

    Redesign the page. That's simply how it works. The entire space of the frame is always live.
    Try dragging in the middle where there's no content and you'll see that the content still scrolls.
    Bob

  • [HELP] quality of image got from Robot.createScreenCapture

    Hi Friends,
    I am using Robot to catch the screen shot like bellow code:
    BufferedImage screencapture = new Robot().createScreenCapture(
    new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) );
    // Save as JPEG
    File file = new File("test.jpg");
    ImageIO.write(screencapture, "jpg", file);
    But the quality of the image I got is not good enough.
    The program ran in window RDC(Remote Desktop Connection), all images generated are not accepable. The string in GUI can not be identified from background.
    If I use PrintScreen key to catch the screen, image quality is much higher.
    Anybody can give me some advices? How can the program be improved? Or is there any other way to capture screens in Java?
    Thanks in advance!
    Yushui

    The output image quality is definitely dependent on the parameter used during the jpeg encoding. If you want to have more control over the compression ratio, you might want to use the jai package.
    http://java.sun.com/products/java-media/jai/
    As for the capture itself, I can assure you that there is no loss of information. Use the following method to convince yourself:     public static void main(String[] args) {
              BufferedImage screencapture = null;
              try {
                   screencapture = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
              } catch (AWTException e) {
                   e.printStackTrace();
              final JFrame frame = new JFrame();
              ImageIcon imageIcon = new ImageIcon(screencapture);
              JLabel label = new JLabel(imageIcon);
              frame.setContentPane(new JScrollPane(label));
              frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              frame.pack();
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        frame.show();
         }Hope this helps.

  • HOW TO CAPTURE THE COMPANY CODE IN MIR7

    Hi ALL,
    MIRO data transfer i am facing some problem
    initially i am capturing the Company code in MIRO
    after that i am filling up all those values.
    for my requirement
    1.i want to hold the company code screen initially at all time
    other wise
    2. i am getting error message as No batch input screen for 'SAPLMR1M" '1000' while i am execution of the second time of MIRO posting  how to eliminate the error message.
    Please advise.
    Thanks & Regards
    K.Gunasekar.

    Hi All
    I am doing BDC in FV60( Recording) is it possible to pass the value into hidden fields through (BDC)
    SCREEN FIELD NAME: Document Type.
    Document type is hidden through FV00 and also without changing configuration in IMG.
    Thanks & Regards
    K.Gunasekar.

  • How to capture the video in a file using JMF-RTP?

    Please someone help in capturing the live streaming in a file using JMF......
    Thanks..

    Hi, I have a problem with RTPExport output video files. One side streams H263/RTP(AVTransmit2.java) and other write this steam to a file by RTPExport.java. When network conditions are ideal, output video file has same fps and same number of frames like original file. Problem occures, when theres packet lost in network, then output file has different fps,and also has less frames like original video(because it didnt write missing frames to file, and thats why it get shorter). Pls how can I achieve output file that will have the same fps like original one? How to write to file an identical copy of what I can see while receiveing video with AVReceive2.java? Its there a way to modifi rtpexport or avreceiver to do this? Thanks!

  • Can I capture the video from the TV card or video capture card to publish

    Can I capture the video from the TV card or video capture card to publish?
    I tried to use the USB camera, it's OK. But, will the TV card or video capture card also work?

    Hi,
    iChat will set up a Video chat window that takes in to account your Processor speed and Internet Speed and to some extent the Buddy's speed.
    This then denotes the pixel content of each frame.
    OS X 10.6.x tells me this is iChat 5 which in turn mean you have  at least an Intel Core 2 Duo Processor.
    This should be capable of 30 frames a sec at  about 640 X 480 pixels  (Check the Connection Doctor (Video Menu) and the Statistics tab during a Chat).
    iChat 5 cannot do HD  (Max of 4:3 ratio at the above figures)
    After that it depends how you are recording the chat.
    Quicktime X would do it.
    iChat will do it itself (if the Buddy agrees)
    10:14 PM      Wednesday; February 1, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How to capture the web:input_email element?

    while i try to capture the input box which is the type of "email" but its getting captured as web.element
    web.element(
      112,
      "/web:window[@index='0' or @title='salesforce.com - Customer Secure Login Page']/web:document[@index='0']/web:form[@name='login' or @index='0']/web:input_email[@placeholder='User Name' and @value='[email protected]' and @name='username' and @id='username' and @onkeyup=\"if(this.value != &apos;&apos;){document.getElementById(&apos;clrUsr&apos;).style.display=&apos;block&apos;;}else{document.getElementById(&apos;clrUsr&apos;).style.display=&apos;none&apos;;}\" and @className='input' and @disabled='false' and @tabIndex='0' and @checked='false' and @defaultChecked='false' and @maxLength='-1' and @readOnly='false' and @selectionEnd='18' and @selectionStart='18' and @size='20' and @textLength='18' and @index='0']")
      .pressTab();
    i want to set the value of textbox which is the email. In IE it is recognized as textbox but in Firefox it is recognized as web.element.
    Thanks in advance.

    I also have similar problems with my phone and email field
    I used this temporary solution. Can you please let me know if u find any?
    had to write the below script to make it work. But has any body come across the issue?
    Defeing robot and keyevent
    web.textBox(34, "{{obj.ATG_repo.SIGNUP_email}}").keyPress("abc<SHIFT-2>example");
    robot.keyPress(KeyEvent.VK_DECIMAL);
    web.textBox(34, "{{obj.ATG_repo.SIGNUP_email}}").keyPress("com");

  • Urgent!! How to capture the active windows

    I want to write a program to capture the active windows in the Windows desktop. Can anyone help me. I know to use class "Robot" to capture the screen, but how to determine the position of the active windows in the desktop.
    Thanks...

    This code could work to capture the desktop screen:
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    Image imgs;
    try{
         Robot r = new Robot();
    Rectangle rect = new Rectangle(0,0,d.width,d.height);
    imgs = r.createScreenCapture(rect);
    }catch(AWTException awe) {
    System.out.println("robot excepton occurred");
    Try this!!!

  • What is the blank  frame with broken  photo mean ?

    After I edited a picture in Photoshop Elements 9 I  then  put it into an e mail attachment. I was then switched to the organizer that had a blank spot with a broken photo . I could not get any explanation. I also was told that i had the wrong format to email. Does this mean I can't email an edited photo ? What does the broken frame mean ?

    Thank you Jim. I do have one more question with regards to your advice:
    I am putting the new firmware on my GH2 today, so I will be able to capture 1080/30p as opposed to only 1080/60i to edit in the 30p timeline. Is there a reason you would prefer 60i over true 30p at the same res? I've had problems with interlacing in the past never quite going away and getting funky when doing slow motion and other effects.

  • Capturing data acquisition frames reliably at 100 hz using serial, how?

    Hi All,
    I am completing development of a 14 channel, 10 bit resolution, pic based data acquisition circuit. It transmits frames of 41 bytes (currently) at 100hz using serial. The embedded code functions satisfactorily. I can see data ok using hyperterminal. I am unsure how to optimise labview to get complete frames without hogging lots of cpu/system resource etc. eg. do I simply set the frame size (num of bytes) to retrieve and set this looping as fast as possible , and/or set the rate to fetch frames at the rate frames are transmitted by the pic? This may allow drift in available buffered bytes to finally overflow the buffer.
    I tend to lose 1 byte in 100 typically doing nothing but this increase
    s to chunks of bytes if I interact with windows.
    I have the feeling a number of decisions need making when setting up a serial link like this but I am unsure which settings best suit my application.
    Thanks in advance,
    Regards
    Chris

    Hi Lynn, Tristan,
    Please find the current llb attached. This has my last serial run and shows how the data gets glitchy after a number of seconds (toward end of the text box).
    I have spent time building the suggestions into code. I am not yet trying to strip out individual channels. At the moment I just want to get frames in reliably before moving on.
    It certainly looks a lot more reliable now but a few more questions have been raised. I think the idea of getting data in using 1 loop then immediately passing it for processing by another parrallel loop seems important for reliability.
    You will notice I grab a frame and it then goes into a que where it will be processed but this needs doing quickly as frames will be used in realti
    me.
    I have set up the code to trim the delay for both the get data from serial port loop and get 1 entry from the que loop.
    I am using 2 identical circuits in my product, 1 captures data from a leg harness, the other controls movements of a biped robot (servos) this occurs in "real time". I need to remove as much latency due to processing as possible.
    click on "video 3" on the right of the page for a prototype demo:
    http://www.robotic-systems.co.uk/products/full_system.htm
    I noticed that some of text embedded within text boxes used in subvi's can tend to float thro to the top level vi. I proved this by adding a bit of text and noticed it kept cropping up occasionally on the top level text box. I found this peculiar but cured it by deleting all chars in the subvi text box. Now I am concerned, could this be somthing to do with why I get glitches in text occasionally?
    Is there some labview feature to say flush all text, numbers and bools prior to running from the top leve
    l?
    I'd be gratefull if you have a look thro my llb and sanity check the flow of code and let me know what you think.
    Best Regards
    Chris
    Attachments:
    Monitor.llb ‏722 KB

  • What is the best frame rate to shoot/edit with for export to DVD?

    Hello, I am going to shoot some instructional martial arts videos that need to be exported to DVD. I haven't exported to DVD since 2005. I am curious what the best frame rate is to shoot with and edit in Premiere to export to DVD. I've read conflicting information online. Some forums say that you can edit in whatever frame rate you want as long as the output is SD, 30i, which seems outdated to me.
    I'm shooting on the GH2, so my options are 1080 24p (which has terrible strobiness compared to other cameras at 24p), 1080 60i, 720 60p, and apparently there is an HBR firmware update that allows 1080 30p. I want the motion to be as unstroby as possible, without being too soft. My friend's camera can shoot 1080 60p and I'm considering buying the G6, which also shoots 1080 60p. But I've read online that 60p to DVD looks choppy.
    Any advice would be greatly appreciated. Thank you very much.
    Jeremy

    Thank you Jim. I do have one more question with regards to your advice:
    I am putting the new firmware on my GH2 today, so I will be able to capture 1080/30p as opposed to only 1080/60i to edit in the 30p timeline. Is there a reason you would prefer 60i over true 30p at the same res? I've had problems with interlacing in the past never quite going away and getting funky when doing slow motion and other effects.

  • Has anybody captured an error frame occurence with CAN driver version 2.2

    I was very excited about the appearance of the Comm Error Frame Type in version 2.0 of the driver. I have a Series 2 card and was working with the CAN driver version 2.2 to attempt capture error frames with an in house written tool.
    Currently we have a tool from Vector that we must use to monitor our CAN system for Error Frames that occur due to a discrepancy in the ATMEL CAN core that we are using. We would like to get rid of the Vector tool and though we could because this capability appeared to be available in the NI driver.
    I executed ncConfig with NC_ATTR_LOG_COMM_ERRS = NC_TRUE and the called the ncRead command to get data from the Read Queue. The tools built upon the NI CAN driver and the Vector tool seen exactly the same data, except that when the a communication attempt was turned into an error, the Vector tool indicated and Error Frame had occurred and nothing was available from the NI tool.
    Has anybody captured an NC_FRMTYPE_COMM_ERR Frame with the ncRead command, and if so would you be willing to help.
    Thanks.

    biker2000 and LoganS
    Thanks for all of the support on this issue, I am better understanding how the NI CAN card works.
    However, the described functionality provides little to no value in how I am using the National Instruments CAN card and I have submitted a Product Suggestion through the link provided earlier in this thread. Your example describes exactly why the implemented Error reporting is not useful. Many errors have to occur before the transition to Error Passive, but you only get the last one, which may or may not reflect what the overall problem is in the system.
    Also, this leads me to another problem that I am having. The transition to Error Passive and Bus Off were added in a recent version of the CAN driver. Was there ever any though to making this configurable. It is problematic for me every time I restart the system that the NI card is connected to because the NI card ends up in Bus Off. I know this is following the CAN Protocol (our physical layer has Dominant = Zero = 0 V, when the system is powered down the NI Card would see may consecutive Dominant bits) because of Rule 6, section 8 (Fault Confinement) in the Bosch CAN specification. However, the NI card in my application is being used to monitor and interact with the system, it is not part of the functioning system. When it goes to Bus Off, my test application is dead. I would rather the occurrence of errors get reported, so I can see what the problem is, and fix what is wrong with the system, but still continue to function as best possible. I use the NI card in a lab environment for testing.
    Again, thanks for everything
    Nathan

Maybe you are looking for