Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java take and save screenshot

public void captureScreen(String fileName) throws Exception {
   Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
   Rectangle screenRectangle = new Rectangle(screenSize);
   Robot robot = new Robot();
   BufferedImage image = robot.createScreenCapture(screenRectangle);
   ImageIO.write(image, "png", new File(fileName));
}
Comment

java take and save screenshot

Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
BufferedImage capture = new Robot().createScreenCapture(screenRect);
ImageIO.write(capture, "bmp", new File(args[0]));
Comment

PREVIOUS NEXT
Code Example
Java :: Simple For Loop Java Example 
Java :: scaletype android dynamic 
Java :: hibernate onetone with mapsid 
Java :: how to disable coming back to activity android studio 
Java :: is c# similar to java 
Java :: stringbuilder with delimiter java 
Java :: stringbuilder java setlength 
Java :: java list of a class has a string that is equal to 
Java :: sort java array 
Java :: java string strip 
Java :: run java file 
Java :: check if short int or long java 
Java :: java scanner next() 
Java :: precision java 
Java :: final variable java 
Java :: Java Scanner nextInt() 
Java :: Java Nested and Inner Class 
Java :: java binary exponentiation 
Java :: convert string into unicode java 
Java :: How to solve the knapsack problem, in Java? 
Java :: spring swagger ui login oauth2 
Java :: spring login response data 
Java :: array methods in java 
Java :: jre in java 
Java :: Java TestNG Data Provider example 
Java :: java loop find index 
Java :: receive an int from terminal java 
Java :: connect as SYSDBA java 
Java :: add image in loggin view spring boot security 
Java :: var keyword not working in spring boot application 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =