Click to See Complete Forum and Search --> : screen capture in java


narayanrm
February 28th, 2000, 07:35 AM
I have to capture the desktop screen.I have tried with jdk1.3
beta java.awt.robot but it has given an error.i am now trying
with VC getDesktopWindow method of win32 api.Still i am not
getting that. I would be greatly thankful to you if you provide
me with a workable solution.thanks in advance.

Narayan

narayan rallabandi murthy

muscicapa
October 14th, 2000, 01:49 AM
There is no direct WIN32 api for screen capture, you need to createCompatibleDC with the DC of the window to capture and BitBlt the data into the new DC and save to file with CreateBitmap and BITMAP HEADER info included. Look at the code in the VC++ discussion.

daileyps
October 16th, 2000, 01:19 PM
Try this:

public void actionPerformed(ActionEvent e) {
PrinterJob printJob = PrinterJob.getPrinterJob();
printJob.setPrintable(this);
if (printJob.printDialog()) {
try {
printJob.print();
} catch (Exception prt) {
System.err.println(prt.getMessage());
}
}
}