Skip to content

Screen capture tool to capture or grab an specific window on Desktop in Java

Notifications You must be signed in to change notification settings

Lxnus/ScreenCapture4J

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

ScreenCapture4J

Screen capture tool to capture or grab an specific window on Desktop in Java

ScreenCapture4J is created to capture or grab a custom window on the desktop. You also have the option to save the window as image or gif to your computer.

Requiments

Java Native Interface (JNI)
Java Native Access (JNA)

Usage

public void grabScreen() {
     ScreenCapture screenCaputre = new ScreenCapture("<yourWindowName>"); // <yourWindowName> -> change to the title of you window, you want to capture!
     BufferedImage image = null;
     while(true) {
          image = screenCapture.current_image();
          
          // type your action -> idea: grab screen to classify an object on live screen with an neural network...
          
          try {
               new Thread();
               Thread.sleep(25); // change number -> how fast the image gets updated!
          } catch(IOExeption e) {}
     }
     
     /**
      * If you want to save the image!
      * formats ["png", "jpg", "gif"]
      */
      screenCapture.save_image("MyFile", "png"); // change first param to edit the fileName ; change second param to edit the format!
}

About

Screen capture tool to capture or grab an specific window on Desktop in Java

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages