Board index » delphi » Jpeg and blobfield

Jpeg and blobfield

Continue the issue from previous emails:
After the *.jpg was saved in a blobField
can it be displayed in a DBImage or if not
how to display it in a TImage?
Thanks Sorin
 

Re:Jpeg and blobfield


Hi:

The following works with DBISAM databases and should give you some idea how
to proceed.

...Bud

Uses
    JPEG;

procedure TfmjbrQMpics.DBISAMTable1AfterScroll(DataSet: TDataSet);
var
  MS: TMemoryStream;
  J1: TJPEGImage;
begin
  Screen.Cursor := crHourglass;
  Try{Finall}
    If DBISAMTable1Picture.IsNull
      then Image1.Picture.Assign(nil)
      else begin
        J1 := TJPEGImage.Create;
        MS := TMemoryStream.Create;
        try
          DBISAMTable1Picture.SaveToStream(MS);
          MS.Seek(0,soFromBeginning);
          with J1 do begin
            PixelFormat := jf24Bit;
            Scale := jsFullSize;
            Grayscale := False;
            Performance := jpBestQuality;
            ProgressiveDisplay := True;
            ProgressiveEncoding := True;
            LoadFromStream(MS);
          end;
          Image1.Picture.Assign(J1);
        finally
          J1.Free;
          MS.Free;
        end;
      end;
  Finally
    Screen.Cursor := crDefault;
  End;
end;

Quote
"sorin" <so...@netvision.net.il> wrote in message news:3b9ce32c$1_1@dnews...
> Continue the issue from previous emails:
> After the *.jpg was saved in a blobField
> can it be displayed in a DBImage or if not
> how to display it in a TImage?
> Thanks Sorin

Other Threads