insert .jpeg files to Oracle

狂风中的少年 提交于 2019-12-24 11:19:10

问题


hi I inserted into oracle database image file on delphi7 with OpenPictureDialog1. All files are .bmp I want to insert .jpeg(.jpg) files. How can I insert this? Thanks in advance.


回答1:


Add jpeg to the uses clause.

uses
    jpeg;



回答2:


convert bmp to jpg

function BMPtoJPG
   (var BMPpic, JPGpic: string):boolean;
var Bitmap: TBitmap;
    JpegImg: TJpegImage;
begin
  Result:=False;
  Bitmap := TBitmap.Create;
  try
   Bitmap.LoadFromFile(BMPpic) ;
   JpegImg := TJpegImage.Create;
   try
    JpegImg.Assign(Bitmap) ;
    JpegImg.SaveToFile(JPGpic) ;
    Result:=True;
   finally
    JpegImg.Free
   end;
  finally
   Bitmap.Free
  end;
end;

Usage: BMPtoJPG('mybitmap.bmp','myjpeg.jpg')

very useful link about jpeg unit

http://www.hamslab.com/lab/delphi/jpeg/jpeg_del.html

how to send jpeg to oracle

1) save jpeg to a file.
2) here you have how to save a file to Oracle:

http://www.delphi3000.com/articles/article_1523.asp?SK=

best regards,
Radu




回答3:


FWIW, unless Jpeg is a requirement, I would use PNG for storage. Jpeg will lose quality in compression. It will be ok for photos, but for diagrams, screenshots, or anything with text, quality will suffer.



来源:https://stackoverflow.com/questions/5308661/insert-jpeg-files-to-oracle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!