图片放在qrimage中的,您有别的办法也行。

解决方案 »

  1.   

    自己解决了,没用qrimage,用TPrinter自己写的。
    主要代码来源于大富翁上以前的贴子,图片文件格式为wmf(图元文件)
    自己加的:
      Image1.Picture.Graphic.Height:=Hei;
      Image1.Picture.Graphic.Width:=Wid;
    这两句十分重要。
    限于兄弟们分享如下:
      procedure TFpms_make_table.SpeedButton4Click(Sender: TObject);
    var
      Ratio,Ratio1,Ratio2:Double;
      wid,hei,X,Y:integer;
      DestRect: TRect;
    begin
      if Image1.Picture=NIL then exit;
    //*************************************************************
      //按照纸张大小伸缩打印************** Add by cjf 2003-6-23
      if not PageSetupDialog1.Execute then exit;
      Ratio1 := Printer.PageWidth / Image1.Width;    //Ratio1: Double
      Ratio2 := Printer.PageHeight / Image1.Height;  //Ratio2: Double
      if Ratio1 < Ratio2 then Ratio := Ratio1       //Ratio: Double
      else Ratio := Ratio2;
      Wid := Round(Ratio * Image1.Width);            //Wid: Integer
      Hei := Round(Ratio * Image1.Height);           //Hei: Integer
      X := (Printer.PageWidth - Wid) shr 1;         //X: Integer
      Y := (Printer.PageHeight - Hei) shr 1;        //Y: Integer
      DestRect := Rect(X, Y, X + Wid, Y + Hei);     //DestRect: TRect
      Image1.Picture.Graphic.Height:=Hei;
      Image1.Picture.Graphic.Width:=Wid;
      try
        Printer.BeginDoc;  // **
        Printer.Canvas.StretchDraw(DestRect, Image1.Picture.Graphic);  // **
      finally
        Printer.EndDoc;
      end;
    //*************************************************************
    end;
    分数吗,这么多天只有WWWWA(aaaa) 大侠一人关注,我也崇拜两星级高手,送个人情吧,老兄以后多帮忙呀。