dbimage绝对可以
下面是用流的形式放到数据库里或从数据库里取放到image里的
var str:Tmemorystream;
if image1.Picture.Graphic<>nil then //把img里的图片用流形式保存到数据库
begin
str:=Tmemorystream.Create;
image1.Picture.Graphic.SaveToStream(str);
str.Position:=0;
Tblobfield(wsdaDataf.Query_wj.FieldByName('photo')).loadfromstream(str);
str.Free;
end
else
begin
wsdaDataf.Query_wj.FieldByName('photo').value:=null;
end;
if wsdaDataf.Query_wj.FieldByName('photo').value='' then //从数据库中取出流转换成图形
begin
image1.Picture.Graphic:=nil;
end
else
begin
try
str:=Tmemorystream.Create;
str.Position:=0;
Tblobfield(wsdaDataf.Query_wj.FieldByName('photo')).SaveToStream(str);
str.Position:=0;
image1.Picture.Graphic:=nil;
image1.Picture.Graphic:=TJpegImage.Create; //这里是jpeg的,可以改成bmp
image1.Picture.Graphic.LoadFromStream(str);
except
Image1.Picture.Bitmap.LoadFromStream(str);
end;
str.Free;
end;