W
wanglong
Unregistered / Unconfirmed
GUEST, unregistred user!
我已经在uses中加入了jpeg,并且数据库中有图象!
var
MyJpeg:TJpegImage;
MyStm:TMemoryStream;
begin
if not Table.FieldByName('图象').IsNull then
begin
try
MyJpeg:=TJpegImage.Create;
MyStm:=TMemoryStream.Create;
MyStm.Clear;
TBlobField(Table.FieldByName('图象')).SaveToStream(MyStm);
MyStm.Position:=0;
MyJpeg.LoadFromStream(MyStm);
FootImage.Picture.BitMap.Assign(MyJpeg);
finally
MyJpeg.Free;
MyStm.Free;
end;
end;
var
MyJpeg:TJpegImage;
MyStm:TMemoryStream;
begin
if not Table.FieldByName('图象').IsNull then
begin
try
MyJpeg:=TJpegImage.Create;
MyStm:=TMemoryStream.Create;
MyStm.Clear;
TBlobField(Table.FieldByName('图象')).SaveToStream(MyStm);
MyStm.Position:=0;
MyJpeg.LoadFromStream(MyStm);
FootImage.Picture.BitMap.Assign(MyJpeg);
finally
MyJpeg.Free;
MyStm.Free;
end;
end;