FAQ » Grafika

Jak wydrukować JPEGa

uses JPEG;
 
procedure TForm1.ReportSystem1Print(Sender: TObject);
 
var
  Stream: TMemoryStream;
  Image: TJPEGImage;
 
begin
  With Sender as TBaseReport do begin
    Stream := TMemoryStream.Create;
    Image := TJPEGImage.Create;
    try
      Image.LoadFromFile('image1.jpg');
      Image.SaveToStream(Stream);
      Stream.Position := 0;
      PrintImageRect(1,1,3,3.5,Stream,'JPG');
    finally
      Image.Free;
      Stream.Free;
    end; { try }
  end; { with }
end;


Kod pochodzi z torry.net