Z
zfine
Unregistered / Unconfirmed
GUEST, unregistred user!
我用DBImage显示数据库(SQL Server2000,Image字段)中,老是出错(Jpeg图片)。
代码如下:
procedure TForm1.Button2Click(Sender: TObject);
var
mt:TStream;
begin
mt:=ClientDataSet1.CreateBlobStream(clientdataset1.fieldbyname('photo'),bmRead);
DBImage1.Picture.Graphic.LoadFromStream(mt);
mt.free;
end;
代码如下:
procedure TForm1.Button2Click(Sender: TObject);
var
mt:TStream;
begin
mt:=ClientDataSet1.CreateBlobStream(clientdataset1.fieldbyname('photo'),bmRead);
DBImage1.Picture.Graphic.LoadFromStream(mt);
mt.free;
end;