P
peterluolaw
Unregistered / Unconfirmed
GUEST, unregistred user!
我都快疯了.到底用什么才能把JPG图片通过DBIMAGE转换为BMP后加入到DBASE的BLOB字段中?!代码到底有没有问题?!JPEG已经添加了!这个玩意真的要把我逼疯了.求大家救我一命吧!
procedure TForm1.Button1Click(Sender: TObject);
var
MyJpeg: TJpegImage;
begin
if openpicturedialog1.Execute then
begin
MyJpeg :=TJpegImage.Create;
MyJpeg.LoadFromfile(openpicturedialog1.filename);
table1.edit;
DBImage1.Picture.Bitmap.assign(bitmap);
//提示 BITMAP IMAGE NOT VALID
//若改为 DBImage1.Picture.assign(myjpeg);
//则没有任何提示,但图片并没有保存下来,0字节.
//奇怪的是当改为 DBImage1.Picture.graphic.assign(myjpeg);
//则提示也一样是 BITMAP IMAGE NOT VALID!!!
table1.Post;
MyJpeg.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
MyJpeg: TJpegImage;
begin
if openpicturedialog1.Execute then
begin
MyJpeg :=TJpegImage.Create;
MyJpeg.LoadFromfile(openpicturedialog1.filename);
table1.edit;
DBImage1.Picture.Bitmap.assign(bitmap);
//提示 BITMAP IMAGE NOT VALID
//若改为 DBImage1.Picture.assign(myjpeg);
//则没有任何提示,但图片并没有保存下来,0字节.
//奇怪的是当改为 DBImage1.Picture.graphic.assign(myjpeg);
//则提示也一样是 BITMAP IMAGE NOT VALID!!!
table1.Post;
MyJpeg.Free;
end;
end;