Printing a shell [message #756442] |
Sun, 13 November 2011 06:28  |
Eclipse User |
|
|
|
Hi all, I'm lorenzo and I'm new in this forum.
I write you because I can't print with swt library.
I have a Shell with some elements I'd like to print all contents in the shell (like a printscreen). I find some examples, but at the moment I print a white paper.
the code that I insert in the click-event of a button is:
PrintDialog printDialog = new PrintDialog(shell); // "shell" is the most bigger object that contain all the items I'd like to print
PrinterData printerData = printDialog.open();
Printer printer = new Printer(printerData);
printer.startJob("");
printer.startPage();
GC gc = new GC(printer);
printer.endPage();
gc.dispose();
printer.endJob();
printer.dispose();
Someone can help me?!?
Thanks in advance
Lorenzo
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03720 seconds