Mega Code Archive

 
Categories / Delphi / Examples
 

How to print an image [jpeg, bmp any]

Question: How can I print a TGraphic, especially an image? Answer: You need to use the global Printer instance from unit Printers - see the code below: uses Printers; procedure PrintBitmap(aGraphic: TGraphic; Title: string); begin { PrintBitmap } Printer.Title := Title; Printer.BeginDoc; Printer.Canvas.Draw(0, 0, aGraphic); Printer.EndDoc end; { PrintBitmap }