Class ImageCaptureExample
- java.lang.Object
-
- org.eclipse.nebula.paperclips.snippets.ImageCaptureExample
-
public class ImageCaptureExample extends java.lang.Object
Demonstrate capturing the pages of a print job to in-memory images.
-
-
Constructor Summary
Constructors Constructor Description ImageCaptureExample()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.swt.graphics.ImageData
captureImageData(org.eclipse.swt.printing.Printer printer, PrintPiece page, org.eclipse.swt.graphics.Point imageSize)
Captures the page to an image and returns it.static Print
createPrint()
Returns a sample printprivate static java.lang.String
getImageName(int index)
static void
main(java.lang.String[] args)
Demonstrate capturing the pages of a print to in-memory images.
-
-
-
Method Detail
-
createPrint
public static Print createPrint()
Returns a sample print- Returns:
- a sample print
-
captureImageData
public static org.eclipse.swt.graphics.ImageData captureImageData(org.eclipse.swt.printing.Printer printer, PrintPiece page, org.eclipse.swt.graphics.Point imageSize)
Captures the page to an image and returns it.- Parameters:
printer
- the printer device.page
- the page to capture.imageSize
- the size of the returned image- Returns:
- an image of the captured page.
-
getImageName
private static java.lang.String getImageName(int index)
-
main
public static void main(java.lang.String[] args)
Demonstrate capturing the pages of a print to in-memory images.- Parameters:
args
- command-line arguments (ignored)
-
-