Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4691481

Mouse cursor not visible when using Robot.createScreenCapture()

XMLWordPrintable

    • tiger
    • x86
    • linux



      Name: jk109818 Date: 05/24/2002


      FULL PRODUCT VERSION :
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

      FULL OPERATING SYSTEM VERSION :Red Hat Linux 7


      A DESCRIPTION OF THE PROBLEM :
      I used this code to create a screencapture application


      import java.awt.*;
      import java.awt.Image.*;
      import javax.imageio.*;
      import java.io.*;
      public class test{
      public static void main(String args[]){
      try{
      Robot tt=new Robot();
      Rectangle screen=new Rectangle(1024,768);
      File f1 = new File("/home/hari/java/test.jpg");
      javax.imageio.ImageIO.write(tt.createScreenCapture(screen),"jpg",f1);
      }catch(Exception e){System.out.println(e);}
      }
      }


      This code returned me the screencapture of my desktop but i
      just don't see the mouse arrow in the jpeg that it produced
      don't you think it's a bug????

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.Run this code

      import java.awt.*;
      import java.awt.Image.*;
      import javax.imageio.*;
      import java.io.*;
      public class test{
      public static void main(String args[]){
      try{
      Robot tt=new Robot();
      Rectangle screen=new Rectangle(1024,768);
      File f1 = new File("/home/hari/java/test.jpg");
      javax.imageio.ImageIO.write(tt.createScreenCapture(screen),"jpg",f1);
      }catch(Exception e){System.out.println(e);}
      }
      }



      2.Now check the jpg image
      3.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      I would like to see every activity on my desktop when i
      screencapture my desktop but i see everything other then
      mouse pointer

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;
      import java.awt.Image.*;
      import javax.imageio.*;
      import java.io.*;
      public class test{
      public static void main(String args[]){
      try{
      Robot tt=new Robot();
      Rectangle screen=new Rectangle(1024,768);
      File f1 = new File("/home/hari/java/test.jpg");
      javax.imageio.ImageIO.write(tt.createScreenCapture(screen),"jpg",f1);
      }catch(Exception e){System.out.println(e);}
      }
      }
      ---------- END SOURCE ----------
      (Review ID: 145457)
      ======================================================================

            bchristi Brent Christian
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: