dbimage图形字段的存储.(100分)

  • 主题发起人 主题发起人 dingzz
  • 开始时间 开始时间
D

dingzz

Unregistered / Unconfirmed
GUEST, unregistred user!
怎样保存图片到image字段中.
 
这是我保存到 access 库中的代码,希望对你有帮助:<br>&nbsp; &nbsp;Image:=TBitmap.Create;<br>&nbsp; &nbsp;try<br>&nbsp; &nbsp; &nbsp;tl.LoadFromFile(FIlename);<br>&nbsp; &nbsp; &nbsp;if tl.Count&gt;0 then<br>&nbsp; &nbsp; &nbsp;begin<br>&nbsp; &nbsp; &nbsp; &nbsp;unit3.qfjg.ImageList1.GetBitmap(0,Image);//这一行是从一个ImageList中获取图片的<br>&nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.SQL.Clear;<br>&nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.SQL.Add(SqlStr1);<br>&nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.Open;<br>&nbsp; &nbsp; &nbsp; &nbsp;for i:=0 to tl.Count-1 do<br>&nbsp; &nbsp; &nbsp; &nbsp;begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.Append;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.Edit;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.FieldByName('MsgID').AsString:=ID;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.FieldByName('SendTo').AsString:=tl.Strings;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.FieldByName('ICO').Assign(Image);//这一行是保存图片的<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADOQTemp.Post;<br>&nbsp; &nbsp; &nbsp; &nbsp;end;<br>&nbsp; &nbsp; &nbsp;end;<br>&nbsp; &nbsp;finally<br>&nbsp; &nbsp; &nbsp;ADOQTemp.Close;<br>&nbsp; &nbsp; &nbsp;ADOQTemp.Free;<br>&nbsp; &nbsp; &nbsp;Image.Free;<br>&nbsp; &nbsp;end;
 
后退
顶部