Print Bitmap/fr

From Free Pascal wiki

English (en) français (fr) русский (ru)

Comment imprimer une Bitmap ?

// uses Printers;
var
  Scale :LongInt;
begin
  with Printer do
    begin
      BeginDoc;
      Scale := Min(
        Printer.PageWidth div Image1.Picture.Bitmap.Width,
        Printer.PageHeight div Image1.Picture.Bitmap.Height);

      Printer.Canvas.StretchDraw(
        Rect(0, 0, Image1.Picture.Bitmap.Width*Scale, Image1.Picture.Bitmap.Height*Scale),
        Image1.Picture.Bitmap);

      EndDoc;
    end;
end;