Delphi 把单张图片保存到Access数据库


本文整理自网络,侵删。

 
procedure TForm1.BitBtn2Click(Sender: TObject);
var ext:string;
begin
  openpicturedialog1.FileName :='.jpg';
If OpenPictureDialog1.Execute Then
 begin
   image1.Picture.LoadFromFile(openpicturedialog1.FileName );
      if image1.picture.Graphic <> nil then  
    begin
       adoquery1.Edit;
       adoquery1.FieldByName('图片').Assign(image1.Picture.Graphic);
       ext:=extractfileext(openpicturedialog1.FileName );
   if uppercase(ext) = '.BMP' THEN
      adoquery1.FieldByName('格式').VALUE :='bmp'
   ELSE
     IF (UPPERCASE(EXT) = '.JPEG') OR (UPPERCASE(EXT) = '.JPG') THEN
      adoquery1.FieldByName('格式').VALUE := 'jpg';
   adoquery1.Post;
   end;
end;
end;
 
――――――――――――――――

原文链接:https://blog.csdn.net/qq_33536143/article/details/85756491

相关阅读 >>

如何将string变量赋值给pchar变量

Delphi中窗体的方法

Delphi 中string字符串转换byte[]字节数组

Delphi datetimetogmt gmt时间与tdatetime转换

dededl安卓中保持屏幕常亮

Delphi xe7 android通过配置实现splash功能

Delphi产生不重复随机数的算法

Delphi 启动程序隐藏主窗体

Delphi中dataset和json的互转

Delphi webbrowser 去除滚动条和边框

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...