var aaa:Tbitmap; begin aaa:=Tbitmap.Create; aaa.LoadFromStream(getphoto(id)); end;
别忘记给我加分啊!谢谢!我刚加入CSDN,急需分!
得需要数据库控件 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;
begin
aaa:=Tbitmap.Create;
aaa.LoadFromStream(getphoto(id));
end;
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;