Re: screen capture in java
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.
Re: screen capture in java
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());
}
}
}