ImageEn, unit iemio

TImageEnMIO.PrintImage

TImageEnMIO.PrintImage


Declaration


procedure PrintImage(ImageIndex: integer; 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; const Heading: string = ''; HeadingHeight: Integer = 5; HeadingColor: TColor = clBlack);


Description


Print the specified image by specifying margins, vertical position, horizonal position and size.

Parameter Description
ImageIndex Index of the page/image to print (0 = first image). IEM_SELECTED_IMAGES can be specified for ImageIndex to print all images that the user has selected in the TImageEnMView or IEM_ALL_IMAGES to print all images in the TImageEnMView
PrtCanvas The printing canvas. Specify nil to use the 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 Vertical alignment of the image on the page, e.g. ievpCenter to center
HorizontalPos Horizontal alignment of the image on the page, e.g. iehpCenter to center
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 Level of gamma correction, use 1 to disable gamma correction
PrintAnnotations If true and the image contains imaging or ImageEn annotations they will be 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 added to each printed page


Example


// Print the first image in center of the page with original sizes
Printer.Title := 'ImageEn';
Printer.BeginDoc;
ImageEnMView1.MIO.PrintImage(0, Printer.Canvas, 0, 0, 0, 0, ievpCenter, iehpCenter, iesNormal, 0, 0, 1);
Printer.EndDoc;

// Print the selected image(s) stretched to the page center (respecting the proportions)
Printer.BeginDoc;
ImageEnMView1.MIO.PrintImage(IEM_SELECTED_IMAGES, Printer.Canvas, 0, 0, 0, 0, ievpCenter, iehpCenter, iesFitToPage, 0, 0, 1);
Printer.EndDoc;

// Print the first image as a poster, four pages wide and six pages high
Printer.BeginDoc;
ImageEnMView1.MIO.PrintImage(0, Printer.Canvas, 0, 0, 0, 0, ievpCenter, iehpCenter, iesMultiplePages, 4, 6, 1);
Printer.EndDoc;


See Also


- DoPrintPreviewDialog
- PrintImagePos
- OnPrintPage