Possible Duplicate:
Java Swing : ObtainImage
of JFrame
I Want to take the screenshot of jpanel invisibly how do i do .
i don't have idea please let me know.
Possible Duplicate:
Java Swing : ObtainImage
of JFrame
I Want to take the screenshot of jpanel invisibly how do i do .
i don't have idea please let me know.
I am not sure what do you mean by 'invisibly'.Check this whether it is of any help.
In order to save snapshots from java.awt.Components into JPEG or any other format files, you simply:
void getSnapShot(JPanel panel ){
BufferedImage bufImg = new BufferedImage(panel.getSize().width, panel.getSize().height,BufferedImage.TYPE_INT_RGB);
panel.paint(bufImg.createGraphics());
File imageFile = new File("."+File.separator+snapshotLocation);
try{
imageFile.createNewFile();
ImageIO.write(bufImg, "jpeg", imageFile);
}catch(Exception ex){
}
}