老 老屯 Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-10 #3 1.创建一个TMemoryStream 2.将位图文件保存到这个Stream,并且设置Stream的Position为0 3.用BlobField的LoadFromStream 4.Free这个Stream
1.创建一个TMemoryStream 2.将位图文件保存到这个Stream,并且设置Stream的Position为0 3.用BlobField的LoadFromStream 4.Free这个Stream
L lbwave Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-11 #4 完全代码 var bs:stream; begin bs:=Tdataset.CreateBlobStream(Tdataset.fieldbyname ('fieldname),bmwrite); image1.picture.Bitmap.copytostream(bs); bs.free;//切记 Tdataset.post; end;
完全代码 var bs:stream; begin bs:=Tdataset.CreateBlobStream(Tdataset.fieldbyname ('fieldname),bmwrite); image1.picture.Bitmap.copytostream(bs); bs.free;//切记 Tdataset.post; end;