Hi, Arsen

I am not familiar with Postgresql but these Paradox examples might help. 
To move images in and out of databases is very easy. These save and 
retrieve BMP


procedure TForm1.ButtonImageToDatabaseClick(Sender: TObject);
begin
  TableXXX.Assign(Image1.Picture.Graphic);   // TableXXX is a blob field
end;

procedure TForm1.ButtonImageFromDatabaseClick(Sender: TObject);
begin
  Image1.Picture.Assign(DBImage1.Picture);
end;



To convert to jpeg, a bit more effort is required:

procedure TLoadPhotograph.LoadPhoto(Filename:string);
var
  BMP : TBitMap;
  JPEG : TJPegImage;
 
begin
 
  JPEG := TJPegImage.Create;
  try
    BMP := TBitMap.Create;
    try
      if lowercase(ExtractFileExt(FileName)) = '.jpg' then
        begin
          TablePhotoPhoto.LoadFromFile(Filename);
          //...
        end
      else
        if lowercase(ExtractFileExt(FileName)) = '.bmp' then
          begin
            BMP.LoadFromFile(Filename);
            JPEG.Assign(BMP);
            JPEG.SaveToFile('C:\Photo.jpg');
            TablePhotoPhoto.LoadFromFile('C:\Photo.jpg');
            //...
          end;
    finally
      BMP.Free;
    end;
  finally
    JPEG.Free;
  end;
end;


Of course, you cannot use the root directory of C under Windows Vista 
but this code might get you started.


Bobby Clarke



Arsen Khachatryan wrote:
>
> Hi with that DB I dont know,but in paradox I´ve used a jpeg component 
> and its works great.
> If you need I can send u a link to download from my sait.I ´ve need to 
> buy that,but its works greatly.
>
> ----- Original Message ----
> From: Joan Manuel <[EMAIL PROTECTED] <mailto:joan_mvf%40yahoo.com>>
> To: [email protected] <mailto:delphi-en%40yahoogroups.com>
> Sent: Wednesday, April 11, 2007 3:26:30 AM
> Subject: [delphi-en] Save a Image into a Blob Field with Postgresql
>
> Hello to everyone, i would like to know, how can i save a image into a
> blob field with delphi, i use a postgresql 8.2 database.
>
> this is my first time that i write to this group.
>
> Im making a project for my university, all my friends use microsoft
> products, im the only one that is working with delphi and postgresql.
>
> please help me, and excuse my bad english.
>
> bye.
>
> __________________________________________________________
> We won't tell. Get more on shows you hate to love
> (and love to hate): Yahoo! TV's Guilty Pleasures list.
> http://tv.yahoo.com/collections/265 <http://tv.yahoo.com/collections/265>
>
> [Non-text portions of this message have been removed]
>
> 
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 269.2.0/756 - Release Date: 10/04/2007 
> 22:44
>   


[Non-text portions of this message have been removed]

Reply via email to