Discord Server Red Security Twitter Donation to Red Security Red Security Youtube Channel Red Security Tumblr Profile
Windscribe
Login or Register to Hide ads and Accessing all features on the forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Taking Screenshot in Java
#1
In The Name OF Allah
Al-Salam Alekum

[Image: Java_logo_icon.png]

Hello guys, Today am gonna give you source code of a simple project which is about taking screenshot using Java Smile

Code:
            // Starting a Robot which is going to take the screenshot for us.
            Robot r = new Robot();
 
            // It saves screenshot to desired path
            String path = "/home/Desktop/Screenshot.jpg";
 
            // Used to get ScreenSize and capture image
            Rectangle capture = 
            new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
            BufferedImage Image = r.createScreenCapture(capture);
           
            // Saving the image to given path from the Buffered Data above.
            ImageIO.write(Image, "jpg", new File(path));


I hope this help you in the future....
Thank you for reading.. Java is Fun Smile .


 Wa Salam Alekum
Rs
* Thankful to Allah *
Kurdy
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question What is the difference between ‘throw’ and ‘throws’ in Java Exception Handling? Mr.Kurd 0 1,209 03-20-2020, 08:49 PM
Last Post: Mr.Kurd
Question Why Java Strings are immutable in nature? Mr.Kurd 0 292 03-20-2020, 08:47 PM
Last Post: Mr.Kurd
Question What is constructor chaining in Java? Mr.Kurd 0 290 03-20-2020, 08:43 PM
Last Post: Mr.Kurd
Question What is the difference between equals() and == in Java? Mr.Kurd 0 301 03-20-2020, 08:40 PM
Last Post: Mr.Kurd
  What public static void main(String args[]) stand for in Java? Mr.Kurd 0 345 03-20-2020, 08:38 PM
Last Post: Mr.Kurd
Question Why multiple inheritance is not supported in java? Mr.Kurd 0 326 03-20-2020, 08:34 PM
Last Post: Mr.Kurd
  10 java skills HeavensReject 1 515 01-12-2020, 05:31 AM
Last Post: Mr.Kurd
Wink Tutorial Downloading video from Youtube using JAVA Mr.Kurd 0 1,163 02-06-2019, 06:33 PM
Last Post: Mr.Kurd
  Tutorial Java and SSH Mr.Kurd 0 1,020 12-16-2018, 08:05 PM
Last Post: Mr.Kurd
  Tutorial Writing to a word file in Java Mr.Kurd 0 807 11-30-2018, 08:43 AM
Last Post: Mr.Kurd



Users browsing this thread: 1 Guest(s)