Board index » delphi » How to display JPEG ? - Looking for DBJPEG

How to display JPEG ? - Looking for DBJPEG

Hello

I have to display Image from BLOB field in Oracle. There is a picture in
JPEG format. Do you have some component, experiences or some advices how can
I do it ? I use Delphi 6 and would like to do it using standart borland
component - what means I want to use JPEG unit shipped with Delphi. If there
is no other way I can use completely third part solution.
Thank in advance
Jaro

 

Re:How to display JPEG ? - Looking for DBJPEG


Maybe you can use the OnAfterScroll-event of your TTable or so. There you
read the field and transfer it to a normal TImage. I don't know if that
works - that possibility just came into my mind...

Helge.

Re:How to display JPEG ? - Looking for DBJPEG


Quote
>Jaro wrote:

> I have to display Image from BLOB field in Oracle. There is a picture in
> JPEG format. Do you have some component, experiences or some advices how

I get used to posting this once every two days <g>.

Use a TImage component and load the jpeg via a MemoryStream. Put this
into the table's AfterScroll event (uses Jpeg):

var
  jp: TJPEGImage;
  ms: TMemoryStream;
begin
  jp := TJPEGImage.Create;
  ms := TMemoryStream.Create;
  try
    (Table1.Fieldbyname('Pict') as TBlobField).SaveToStream(ms);
    ms.Seek(0, soFromBeginning);
    with jp do begin
      PixelFormat := jf24Bit;
      Scale := jsFullSize;
      Grayscale := False;
      ProgressiveDisplay := True;
      ProgressiveEncoding := True;
      Performance := jpBestQuality;
      LoadFromStream(ms)
    end;
    if ms.Size > 0 then
      Image1.Picture.Assign(jp);
  finally
    jp.Free;
    ms.Free
  end
end;

________
Andreas
Delphi 5.01 Pro, NT4 Sp6a
Direct replies mailto:paw...@gmx.net

Re:How to display JPEG ? - Looking for DBJPEG


That's exactly what I was talking about in my reply - but I didn't know the
exact koding ;-))

Helge.

Re:How to display JPEG ? - Looking for DBJPEG


Thanks. But I have another problem. I need to have possibility to use cut,
copy and paste the image. Is it possible to solve also this problem ?
Jaro

Quote
"Andreas Pawlik" <paw...@gmx.net> wrote in message

news:3B601516.A534D951@gmx.net...
Quote
> >Jaro wrote:

> > I have to display Image from BLOB field in Oracle. There is a picture in
> > JPEG format. Do you have some component, experiences or some advices how

> I get used to posting this once every two days <g>.

> Use a TImage component and load the jpeg via a MemoryStream. Put this
> into the table's AfterScroll event (uses Jpeg):

> var
>   jp: TJPEGImage;
>   ms: TMemoryStream;
> begin
>   jp := TJPEGImage.Create;
>   ms := TMemoryStream.Create;
>   try
>     (Table1.Fieldbyname('Pict') as TBlobField).SaveToStream(ms);
>     ms.Seek(0, soFromBeginning);
>     with jp do begin
>       PixelFormat := jf24Bit;
>       Scale := jsFullSize;
>       Grayscale := False;
>       ProgressiveDisplay := True;
>       ProgressiveEncoding := True;
>       Performance := jpBestQuality;
>       LoadFromStream(ms)
>     end;
>     if ms.Size > 0 then
>       Image1.Picture.Assign(jp);
>   finally
>     jp.Free;
>     ms.Free
>   end
> end;

> ________
> Andreas
> Delphi 5.01 Pro, NT4 Sp6a
> Direct replies mailto:paw...@gmx.net

Re:How to display JPEG ? - Looking for DBJPEG


Quote
>Jaro wrote:

>Thanks. But I have another problem. I need to have possibility to use >cut, copy and paste the image. Is it possible to solve also this problem

Have a look at the 'ClipBoard' methods of TPicture.
________
Andreas
Delphi 5.01 Pro, Win2K Sp2
Direct replies mailto:paw...@gmx.net

Other Threads