1。問題說的多了,人家都懶得理你了。自己發問題前多查點以前的問題吧。
2。你真的上網查了嗎?居然說的言之凿凿說網上沒有。
3。自己不行不要罵別人不行。什麼邏輯!!!
一個Image,兩個button.
procedure TForm1.Button2Click(Sender: TObject);
var
memS:TMemoryStream;
jpg:TJPEGImage;
begin
if ADODataSet1.RecordCount>0 then begin
memS:=TMemoryStream.Create;
ADODataSet1pic.SaveToStream(memS);
memS.Position := 0;
jpg:=TJPEGImage.Create;
jpg.LoadFromStream(memS);
image1.Canvas.Draw(0,0,jpg);
image1.Refresh;
mems.Free;
jpg.free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
memS:TMemoryStream;
bmp:TBitmap;
jpg:TJPEGImage;
begin
if OpenPictureDialog1.Execute then begin
memS:=TMemoryStream.Create;
jpg:=TJPEGImage.Create;
jpg.LoadFromFile(OpenPictureDialog1.FileName);
jpg.SaveToStream(mems);
memS.Position := 0;
image1.Canvas.Draw(0,0,jpg);
ADODataSet1.Active := true;
ADODataSet1.Edit;
ADODataSet1pic.LoadFromStream(memS);
ADODataSet1.Post;
mems.Free;
jpg.free;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ADODataSet1.ConnectionString:=
'Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source='+ExtractFilePath(ParamStr(0))
+'/db1.mdb;Mode=Share Deny None;';
ADODataSet1.Active :=true;
end;