Board index » delphi » Jpeg and IBX

Jpeg and IBX

Hi,

  Is there any Jpeg Component that can be used with IBX? thanks

Frank

 

Re:Jpeg and IBX


What do mean with that?

I you want to save jpeg-data in a blob through IBX then that is possible.

Mail me if you want an example.

Regards,
Timo

"Frank Wang" <w...@cebu.weblinq.com> schreef in bericht
news:01a8e760$ae6bdfa0$0c404eca@frankwan...

Quote
> Hi,

>   Is there any Jpeg Component that can be used with IBX? thanks

> Frank

Re:Jpeg and IBX


PMJI

Hello.  I too wold like to see the sample code of loading something into a
blob field through IBX.

- Lou

Quote
Timo van Noppen wrote:
> What do mean with that?

> I you want to save jpeg-data in a blob through IBX then that is possible.

> Mail me if you want an example.

> Regards,
> Timo

> "Frank Wang" <w...@cebu.weblinq.com> schreef in bericht
> news:01a8e760$ae6bdfa0$0c404eca@frankwan...
> > Hi,

> >   Is there any Jpeg Component that can be used with IBX? thanks

> > Frank

Re:Jpeg and IBX


Saving jpeg to an Interbase-blob-field via IBX is quite simple. Just do
this:

TBlobField(DataSet.FieldByName('Field')).LoadFromFile(FileName);
or
TBlobField(DataSet.FieldByName('Field')).LoadFromStream(Stream);
and after that
TBlobField(DataSet.FieldByName('Field')).Modified := True;

Only remark is to have no TDBImage connected via a TDataSource to the
DataSet. TDBImage cannot handle JPEG.

When you want to view a JPEG stored in a Interbase-table do the following:

Place a TImage on the form with the name Image (that is the name I used
here) and in the OnDataChange or every
other procedure you want, put in this code. Also put 'JPEG' in your uses
clause.

procedure TForm1.OnDataChange;
var
  MS: TMemoryStream;
  JPG: TJpegImage;
begin
  with DataSet do
    if (Active) and (not TBlobField(FieldByName('Field')).IsNull) then
    begin
      JPG := TJpegImage.Create;
      MS := TMemoryStream.Create;
      TBlobField(FieldByName('Field')).SaveToStream(MS);
      MS.Position := 0;
      JPG.LoadFromStream(MS);
      Image.Picture.Assign(JPG);
      JPG.Free;
      MS.Free;
    end;
end;

Timo

Luis Feliz <lfe...@clipboard.com> schreef in berichtnieuws
38A6E5CE.DD370...@clipboard.com...

Quote
> PMJI

> Hello.  I too wold like to see the sample code of loading something into a
> blob field through IBX.

> - Lou

> Timo van Noppen wrote:

> > What do mean with that?

> > I you want to save jpeg-data in a blob through IBX then that is
possible.

> > Mail me if you want an example.

> > Regards,
> > Timo

> > "Frank Wang" <w...@cebu.weblinq.com> schreef in bericht
> > news:01a8e760$ae6bdfa0$0c404eca@frankwan...
> > > Hi,

> > >   Is there any Jpeg Component that can be used with IBX? thanks

> > > Frank

Other Threads