函数如下
 function GetPHOTO(ID : string):stream;
ID 为USER表中的用户号   P hoto 为用户照片
想用这个函数实现通过用户ID返回用户照片的功能
如和实现

解决方案 »

  1.   

    var aaa:Tbitmap;
    begin
    aaa:=Tbitmap.Create;
     aaa.LoadFromStream(getphoto(id));
    end;
      

  2.   

    别忘记给我加分啊!谢谢!我刚加入CSDN,急需分!
      

  3.   

    得需要数据库控件
    function GetPHOTO(ID : string):TStream;
    begin
       with ADOQuery1 do
       begin
           Close;
           SQL.Clear;
           SQL.Add('select * from USER where userid='''+ID+'''');
           try
              Open;
              if not IsEmpty then
                  TBlobField(fieldbyname('photo')).SaveToStream(Result)
              else Result:= nil;
           Except
              on e:Exception do
                MessageBox(Handle,pchar(e.Message),nil,MB_ICONERROR);
           end;
       end;
    end;