Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi 在Rave报表中打印图像_Delphi_Rave Reports - Fatal编程技术网

Delphi 在Rave报表中打印图像

Delphi 在Rave报表中打印图像,delphi,rave-reports,Delphi,Rave Reports,我在Delphi2009和Rave Reports中开发了一个应用程序。我想在报告中打印一张图片。我将如何实现这一点 任何建议都将不胜感激。使用绘图(X,Y:Double;Graphic:TGraphic);方法,除非您正在绘制位图。在这种情况下,请使用TBaseReport.PrintBitmap(X,Y:Double;ScaleX,ScaleY:Double;Bitmap:TBitmap);或PrintBitmapRect(X1、Y1、X2、Y2:Double;位图:TBitmap) Dra

我在Delphi2009和Rave Reports中开发了一个应用程序。我想在报告中打印一张图片。我将如何实现这一点

任何建议都将不胜感激。

使用绘图(X,Y:Double;Graphic:TGraphic);方法,除非您正在绘制位图。在这种情况下,请使用TBaseReport.PrintBitmap(X,Y:Double;ScaleX,ScaleY:Double;Bitmap:TBitmap);或PrintBitmapRect(X1、Y1、X2、Y2:Double;位图:TBitmap)

Draw()记录在ms的D2009帮助文件中-help://embarcadero.rs2009/Rave/draw.htm

var   
  MyLogo: TGraphic;
begin
  MyLogo := TMetafile.Create;
  try
    MyLogo.LoadFromFile('MYLOGO.WMF');
    RvNDRWriter1.Draw(1.0,2.0,MyLogo);
  finally
    MyLogo.Free;
  end; { tryf }
end;
您可以在Delphi 2009帮助文件主题ms中找到PrintBitmap的示例-help://embarcadero.rs2009/Rave/printbitmap.htm -该页面上有PrintBitmapRect()的链接


我对Rave Reports也有同样的问题,这取决于您想要预览或打印的图像类型。如果是WMF,您可以使用Ken White的示例:

var   
  MyLogo: TGraphic;
begin
  MyLogo := TMetafile.Create;
  try
    MyLogo.LoadFromFile('MYLOGO.WMF');
    RvNDRWriter1.Draw(1.0,2.0,MyLogo);
  finally
    MyLogo.Free;
  end; { tryf }
end;
但使用BMP时:

RvNDRWriter1.PrintBitmap( 1.0, 1.0, 2.0, 2.0, MyBitmap );
使用JPEG图像时:在调用RvNDRWriter1之前,必须先将JPEG转换为BMP

Jpeg2bmp('temp.bmp',jpegfile);
pic1.picture.loadfromfile('temp.bmp');
pic1.Visible:=true;
我注意到大多数答案(在Rave上)通常假设人们完全通过代码来制作报告。没有视觉设计师了吗?(我仍然使用它,但是,Delphi是我们的遗产)。
Jpeg2bmp('temp.bmp',jpegfile);
pic1.picture.loadfromfile('temp.bmp');
pic1.Visible:=true;