L
lyy_whu
Unregistered / Unconfirmed
GUEST, unregistred user!
mstream:=TMemorystream.Create;
mstream.WriteBuffer(STR_MapFilePointer^,temp_ms.wparam);
mstream.SaveToFile('c:/photo1.bmp');
dbimage1.picture.LoadFromFile('c:/photo1.bmp');//得到的是一个dib 无法作为bmp显示
dbimage1.picture.Bitmap.SaveToStream(mstream);
jpgstream:= TJPEGImage.Create;
jpgstream.Assign(dbimage1.picture.bitmap);
jpgstream.CompressionQuality:=1;
jpgstream.Compress;
jpgstream.SaveToStream(mstream);
dbimage1.Picture.Assign(jpgstream);
jpgstream.SaveToFile('c:/photo1.JPG');
oratable1.open;
oratable1.UpdateRecordTypes:=[rtInserted];
oratable1.insert;
oratable1.FieldByName('id).asstring:=id.text;
oratable1photo.LoadFromFile('c:/photo1.bmp');
oratable1.post;
oratable1.ApplyUpdates;
oratable1.Close;
我很想把一个jpg存在数据库中。但是我用oratablephoto(字段名) 因为它是blob
所以我只能存入bmp.. 如何才能把jpg存入数据库 并且通过dbimage显示
mstream.WriteBuffer(STR_MapFilePointer^,temp_ms.wparam);
mstream.SaveToFile('c:/photo1.bmp');
dbimage1.picture.LoadFromFile('c:/photo1.bmp');//得到的是一个dib 无法作为bmp显示
dbimage1.picture.Bitmap.SaveToStream(mstream);
jpgstream:= TJPEGImage.Create;
jpgstream.Assign(dbimage1.picture.bitmap);
jpgstream.CompressionQuality:=1;
jpgstream.Compress;
jpgstream.SaveToStream(mstream);
dbimage1.Picture.Assign(jpgstream);
jpgstream.SaveToFile('c:/photo1.JPG');
oratable1.open;
oratable1.UpdateRecordTypes:=[rtInserted];
oratable1.insert;
oratable1.FieldByName('id).asstring:=id.text;
oratable1photo.LoadFromFile('c:/photo1.bmp');
oratable1.post;
oratable1.ApplyUpdates;
oratable1.Close;
我很想把一个jpg存在数据库中。但是我用oratablephoto(字段名) 因为它是blob
所以我只能存入bmp.. 如何才能把jpg存入数据库 并且通过dbimage显示