Class ImageCaptureExample


  • public class ImageCaptureExample
    extends java.lang.Object
    Demonstrate capturing the pages of a print job to in-memory images.
    • 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 print
      private 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageCaptureExample

        public ImageCaptureExample()
    • 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)