The following code shows you how to take a screenshot using java.The heart of this code is the Robot class. This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The primary purpose of Robot is to facilitate automated testing of Java platform implementations.
To use this class we need to import java.awt.Robot. In eclipse shift+ctrl+o will do all this import stuffs for you.
Here is the method to capture screen shot
/* * This method takes screen shot * @param filename is the file name of the screenshot */ public static void captureScreen(String fileName) throws Exception { //get the dimention (i.e. width & height in pixels) of the screen Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); //Create a rectangular shape of size of the screen Rectangle screenRectangle = new Rectangle(screenSize); //create a new robot object Robot robot = new Robot(); //take a snapshot of the screen BufferedImage image = robot.createScreenCapture(screenRectangle); //write the image to file ImageIO.write(image, "jpg", new File(fileName)); }
createScreenCapture(Rectangle screenRect)creates an image containing pixels read from the screen & returns it as a BufferedImage. You can change the image format from jpg to any other format you like.
For more info on Robot class visit oracle docs here
kırşehir
ReplyDeletekarabük
adıyaman
niğde
ordu
RXG
yurtdışı kargo
ReplyDeleteresimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
İYV2
bitlis
ReplyDeleteurfa
mardin
tokat
çorum
0JX2
https://titandijital.com.tr/
ReplyDeletesakarya parça eşya taşıma
aksaray parça eşya taşıma
urfa parça eşya taşıma
kocaeli parça eşya taşıma
ZNCM5
1D142
ReplyDeleteErzincan Lojistik
Manisa Evden Eve Nakliyat
Karaman Lojistik
Kırıkkale Parça Eşya Taşıma
Isparta Evden Eve Nakliyat
606A2
ReplyDeleteDüzce Şehir İçi Nakliyat
Ardahan Şehir İçi Nakliyat
Kütahya Şehirler Arası Nakliyat
Gümüşhane Şehir İçi Nakliyat
Hakkari Lojistik
Muş Şehirler Arası Nakliyat
Çanakkale Parça Eşya Taşıma
Kırşehir Evden Eve Nakliyat
Nevşehir Parça Eşya Taşıma
68D67
ReplyDeletebinance %20
E5D5E
ReplyDeletereferans kodu %20
38A4B
ReplyDeleteCoin Nasıl Çıkarılır
Binance Kaldıraçlı İşlem Nasıl Yapılır
Bitcoin Nasıl Alınır
Kripto Para Oynama
Madencilik Nedir
Binance Nasıl Oynanır
Binance Nasıl Kayıt Olunur
Bitcoin Nasıl Üretilir
Binance Ne Kadar Komisyon Alıyor
GBJNGYHJM
ReplyDeleteشركة تنظيف
شركة تسليك مجاري بالدمام Ode6JZ35Fy
ReplyDeleteشركة تسليك مجاري بالهفوف hIxTPDWof8
ReplyDeleteشركة تنظيف سجاد بالجبيل UzEK0kCLff
ReplyDeleteشركة تنظيف خزانات uthrLahSxV
ReplyDeleteشركة تسليك مجاري بالاحساء zY8EycwF2T
ReplyDeleteشركة رش حشرات بالاحساء 7EkKlOiGfm
ReplyDelete9B053E1558
ReplyDeleteşov
steroid satın al
cialis
https://pasticciandosi.blogspot.com/2012/09/pane-con-biga-da-20-ore.html?sc=1733829646339#c7036182270869873114 fhBa9LSMwJ
ReplyDelete