要記得把分數給我啊﹗
在form里放一個openpicture 及 dbimage
然后放一個button
在button里這樣寫就可以啦
var
picturename,extname:string;
Jpegimage:TJpegImage;
begin
with Qorder_master do begin
if isempty then exit;
if openpicture.Execute then begin
picturename:=openpicture.FileName;
extname:=extractfileext(picturename);
if uppercase(extname)='.BMP' then
begin
edit;
dbimage.Picture.LoadFromFile(openpicture.filename);
Post;
end;
if (uppercase(extname)='.JPG') OR (uppercase(extname)='.JEPG') then
begin
Jpegimage:=Tjpegimage.Create;
try
Jpegimage.LoadFromFile(picturename);
edit;
dbimage.Picture.Graphic.Assign(Jpegimage);
Post;
finally
jpegimage.Free;
end;
end;
end;
Edit ;
end;
end;
記得在uses 里加入jpeg 單元啊﹗
這個程序啊是我花了十天才寫出來的﹐可以存dbimage里允許的所有格式文件﹗
如果還不清楚請呼oicq﹕2516086