Declaration
procedure PrintImage(ImageIndex: integer; Margins : 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); overload;
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); overload;
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:
◼You do not need to call Printer.BeginDoc/Printer.EndDoc unless you want to print a batch of images
◼Use the
OnPrintPage or
OnPrintPage events to customize the heading added to each printed page
◼When using iesSpecifiedSize,
SpecWidth or
SpecHeight will be adjusted to maintain the image's aspect ratio. Set
PrintingMaintainAR to false to prevent this
◼If you are
printing a PDF, you should use
Print// Print the first image in center of the page with original sizes
ImageEnMView1.MIO.PrintImage(0, 0, evpCenter, iehpCenter, iesNormal, 0, 0, 1);
// Print the selected image(s) stretched to the page center (respecting the proportions)
ImageEnMView1.MIO.PrintImage(IEM_SELECTED_IMAGES, 0, ievpCenter, iehpCenter, iesFitToPage, 0, 0, 1);
// Print all images stretched to the page center (respecting the proportions)
ImageEnMView1.MIO.PrintImage(IEM_ALL_IMAGES, 0, ievpCenter, iehpCenter, iesFitToPage, 0, 0, 1);
// Print the first five images as posters, four pages wide and six pages high
Printer.Title := 'ImageEn';
Printer.BeginDoc();
for i := 0 to 4 do
ImageEnMView1.MIO.PrintImage( i, 0, ievpCenter, iehpCenter, iesMultiplePages, 4, 6, 1);
Printer.EndDoc();
See Also
◼DoPrintPreviewDialog◼PrintImagePos◼OnPrintPage