我看到很多人说可以将FastReport中的Picture控件里的BlodType设置成btJPG,可是我怎么也找不到BlodType属性,请问是什么原因。

解决方案 »

  1.   

    以前写的代码.用的fastReport2.6 .参考一下吧:{方法是:先将数据库中的用内存流读出,然后通过bmp 传递给报表.笨方法,现在也懒的改.}
       if is_include_picture then
          begin
            bmp:=TBitmap.Create;
            tempStream:= TMemoryStream.Create;
            qry:=TADOQuery.Create(nil);         
            try
              qry.Connection:= DM.ADOConnection1;
              qry.close;
              qry.SQL.Clear;
              qry.SQL.Add('select * from tb_Patient_Graphic_INF where V_BRBM=:id1 order by v_lx' ) ;
              qry.Parameters.ParamByName('id1').Value:= BRID;
              qry.Open;
              if qry.RecordCount>0 then
              begin
                j:=1;
                qry.First;
                while (not qry.Eof) and (j<i) and  (pictureCount>0) do
                begin
                  tempStream.Clear;
                  TBlobField(qry.FieldByName('picture')).SaveToStream(tempStream);
                  tempStream.Position:=0;
                  bmp.LoadFromStream(tempStream);
                  try
                    FrView:= FrmPrintSetup.frReport1.Pages[0].findobject('picture'+inttostr(pictureCount)) ;
                    if frview is TfrPictureView then
                      (FrView as TfrPictureView).Picture.Assign(bmp);
                  except
                  end;
                  qry.Next;
                  pictureCount:= pictureCount-1;
                  Inc(j);
                end;
              end;        finally
              bmp.Free;
              tempStream.Free;
              qry.Free;
            end;
          end;