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
// 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); var heightPixels: Integer; begin // If thumbnails, output the current page number. If image printing, output the filename if ThumbnailPrinting then Heading := format( 'Thumbnail Page %d', [ Index + 1 ]) else 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]; end;