D
delphi009
Unregistered / Unconfirmed
GUEST, unregistred user!
我的数据库中的图片存储的是jpg图片
我用下面的方法显示出来了,请问有更好的办法吗(不用文件的形式)
procedure TForm1.BitBtn2Click(Sender: TObject);
var jpg:tmemorystream;
begin
try
jpg:=tmemorystream.Create;
(self.ADOTable1.FieldByName('doctor_photo') as tblobfield).SaveToStream(jpg);
jpg.SaveToFile('e:/1.jpg');
self.Image1.Picture.LoadFromFile('e:/1.jpg');
finally
jpg.Free;
end;
我用下面的方法显示出来了,请问有更好的办法吗(不用文件的形式)
procedure TForm1.BitBtn2Click(Sender: TObject);
var jpg:tmemorystream;
begin
try
jpg:=tmemorystream.Create;
(self.ADOTable1.FieldByName('doctor_photo') as tblobfield).SaveToStream(jpg);
jpg.SaveToFile('e:/1.jpg');
self.Image1.Picture.LoadFromFile('e:/1.jpg');
finally
jpg.Free;
end;