Board index » delphi » How read .jpg .gif to write images in a database field

How read .jpg .gif to write images in a database field

The .bmp format is to long and i need a format to best resolution and
small size as .jpg  or .gif  or  .tif

for example
table.foto.edit ;
table.foto.value := loadfromfile('c:\foto.jpg') ;
table.foto.post ;

thank for your cooperation

Rafael Morales

 

Re:How read .jpg .gif to write images in a database field


Hi Rafael,

I use this:

If OpenDialog.Execute then
        Begin
             with DataModule.MdImages do
             begin
                  Insert;
                  TBlobField(FieldByName('image') as
TBlobField).LoadFromFile(OpenDialog.FileName);
                   Post;
             end;
       end;

Don't forget to put the JPEG unit in your uses clauses.

Regards

Quote
Rafael Morales wrote:
> The .bmp format is to long and i need a format to best resolution and
> small size as .jpg  or .gif  or  .tif

> for example
> table.foto.edit ;
> table.foto.value := loadfromfile('c:\foto.jpg') ;
> table.foto.post ;

> thank for your cooperation

> Rafael Morales

--
<-------------------------------------->
Jean-Pierre Lamon
Music:
http://www.fusions.ch/diy/jurassikpork
Work:
http://www.est-stf.ch
<-------------------------------------->

Other Threads