ImageEn, unit imageenio

TImageEnIO.PrintImage

TImageEnIO.PrintImage


Declaration


procedure PrintImage(PrtCanvas: TCanvas = nil; MarginLeft: double = 1; MarginTop: double = 1; MarginRight: double = 1; MarginBottom: double = 1; VerticalPos: TIEVerticalPos = ievpCenter; HorizontalPos: TIEHorizontalPos = iehpCENTER; Size: TIESize = iesFitToPage; SpecWidth: double = 0; SpecHeight: double = 0; GammaCorrection: double = 1; PrintAnnotations: Boolean = False; PrintLayers: Boolean = False; const Heading: string = ''; HeadingHeight: Integer = 5; HeadingColor: TColor = clBlack);


Description


Print the current image by specifying margins, vertical position, horizontal position and size.

Parameter Description
PrtCanvas The canvas to bring to. Specify nil to use Printer.Canvas
MarginLeft Left page margin in inches (Specify zero for no margin)
MarginTop Top page margin in inches (Specify zero for no margin)
MarginRight Right page margin in inches (Specify zero for no margin)
MarginBottom Bottom page margin in inches (Specify zero for no margin)
VerticalPos How the image is vertically aligned on the page
HorizontalPos How the image horizontally aligned on the page
Size How the image should be sized for printing
SpecWidth The absolute width of the image in inches if Size = iesSpecifiedSize. The number of pages wide if Size = iesMultiplePages
SpecHeight The absolute height of the image in inches if Size = iesSpecifiedSize. The number of pages high if Size = iesMultiplePages
GammaCorrection The gamma correction value (Specify 1.0 to disable gamma correction)
PrintAnnotations If true and the image contains imaging or ImageEn annotations they will be printed
PrintLayers If true and the attached TImageEnView image contains multiple layers, they will be printed. If False, only the image (i.e. current layer) is printed
Heading Specifies the heading to print at the top of the page.
HeadingHeight The height of the heading, as a PERCENTAGE of the overall page height, e.g. 5 will make the heading 5% of the page height.
HeadingColor Specifies the color of the heading text.


Note: Use the OnPrintPage or OnPrintPage events to customize the heading


Demo


  Demos\ImageEditing\CompleteEditor\PhotoEn.dpr



Examples


// Add Printers unit to your uses clause...
uses
  Printers;

// Print the image in the center of the page at the original size
Printer.Title := 'Original Image';
Printer.BeginDoc;
ImageEnView1.IO.PrintImage( Printer.Canvas, 0, 0, 0, 0, ievpCenter, iehpCenter, iesNormal );
Printer.EndDoc;

// Print the image in the center of the page stretched to page dimensions (respecting the proportions)
Printer.Title := 'Stretched Image';
Printer.BeginDoc;
ImageEnView1.IO.PrintImage( Printer.Canvas, 0, 0, 0, 0, ievpCenter, iehpCenter, iesFitToPage );
Printer.EndDoc;

// Print the image as a poster, four pages wide and six pages high
Printer.Title := 'Poster';
Printer.BeginDoc;
ImageEnView1.IO.PrintImage( Printer.Canvas, 0, 0, 0, 0, ievpCenter, iehpCenter, iesMultiplePages, 4, 6, 1 );
Printer.EndDoc;

// Print all pages of a TIFF
Printer.Title := 'TIFF Pages';
Printer.BeginDoc;
for I := 0 to ImageEnView1.IO.Params.ImageCount - 1 do
begin
  ImageEnView1.IO.Params.ImageIndex := I;
  ImageEnView1.IO.LoadFromFile( 'C:\input.tif' );
  ImageEnView1.IO.PrintImage();
end;
Printer.EndDoc;

// Print the image in the center with layers
Printer.Title := 'Layered Image';
Printer.BeginDoc;
ImageEnView1.LayersCurrent := 0; // Select background layer
ImageEnView1.IO.PrintImage( Printer.Canvas, 0, 0, 0, 0, ievpCenter, iehpCenter, iesNormal, 0, 0, 1, False, True );
Printer.EndDoc;


See Also


- PrintImagePos
- OnPrintPage