ImageEn, unit iemio




property OnPrintPage: TIEPrintPageEvent;


Occurs whenever an image or page of thumbnails is printed to allow a heading to be specified.

Parameter Description
Sender Will be either a TImageEnIO or TImageEnMIO control
Index If ThumbnailPrinting is False, Index represents the image in the associated TImageEnMView. If ThumbnailPrinting is true, Index represents the index of the page being printed (e.g. the first of three thumbnail sheets). When printing from a TImageEnIO, Index is always 0
ThumbnailPrinting True, when printing thumbnails from a TImageEnIO using PrintImages or DoPrintPreviewDialog
DpiX, DpiY Resolution of the printed page
PrintWidth, PrintHeight Dimensions in inches of the printed page
Heading Set a valid string to add a heading to the top of the printed page. Defaults to '', meaning that no heading is printed
HeadingFont If a Heading has been specified, configure the font style


// Add headings when printing from a TImageEnMView
procedure TForm1.ImageEnMView1PrintPage(Sender: TObject; Index: Integer;
    ThumbnailPrinting: Boolean; DpiX, DpiY: Integer; PrintWidth, PrintHeight:
    Double; var Heading: string; HeadingFont: TFont);
  heightPixels: Integer;
  // If thumbnails, output the current page number. If image printing, output the filename
  if ThumbnailPrinting then
    Heading := format( 'Thumbnail Page %d', [ Index + 1 ])
    Heading := ExtractFilename( ImageEnMView1.ImageFilename[ Index ]);

  // Output text at 5% of page height (use percentage sizes, rather than fixed values to handle different page sizes)
  heightPixels := Round( PrintHeight * DpiY );
  HeadingFont.Height := heightPixels div 20;
  HeadingFont.Style := [fsBold];

See Also