Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

GIF save to blob field to be loaded from reportbuilder

edited October 2002 in End User
Hello again..

In other word.. How is the best way to save GIF image into BLOB field that
can
be retrieved from TDBImage Component of Reportbuilder. ?

Comments

  • edited October 2002
    duplicate message!
  • edited October 2002
    ok.. Im duplicate message.. but, the last question i'ts not answered...

    i need your help urgently.

    thanks...


    "Chris Ueberall [TeamDM]" escribi? en el mensaje
  • edited October 2002
    Hi Ricardo,

    I answered the prior thread!
  • edited October 2002
    ok.. thanks..


    but...

    it's appears error....

    i thinks thats the problem is to saving GIF in blob file to be loaded
    correctly to TGifImage component....

    How is correct form...

    To saving GIF in a blob, im using.....


    // Image1: TImage; -- > it's a form image component


    procedure SAVE;
    var
    ofs: TStream;
    begin
    TABLE.Append;
    ofs := TMemoryStream.Create;
    FotoPrd.Picture.Graphic.SaveToStream(ofs);
    ofs.position := 0;
    TABLEFieldImage.LoadFromStream(ofs);
    TABLEFieldImageType.AsString :=
    Image1.Picture.Graphic.ClassName;
    TABLE.Post;
    end;

    I'm use this form...

    procedure TForm1.LoadImage;
    var
    ofs: TStream;
    Grclass: TGraphicClass;
    Newgr, NewGrIcon: TGraphic;
    begin

    ofs := TMemoryStream.Create;
    TABLEFieldImage.SaveToStream( ofs );

    Grclass := GetGraphicClass( TABLEFieldImageType.AsString );
    // it's result TGifImage class
    NewGr := Grclass.Create;
    ofs.Position := 0;
    NewGr.LoadFromStream( ofs );
    Image1.Picture.Graphic := Newgr;

    end;



    function GetGraphicClass( cClass: String ): TGraphicClass;
    begin
    if UpperCase(cClass) = 'TJPEGIMAGE' then
    Result := TJPEGImage
    else
    if UpperCase(cClass) = 'TGIFIMAGE' then
    Result := TGIFImage
    else
    if UpperCase(cClass) = 'TBITMAP' then
    Result := TBitmap
    else
    if UpperCase(cClass) = 'TICON' then
    Result := TIcon
    else
    if UpperCase(cClass) = 'TMETAFILE' then
    Result := TMetaFile
    else
    Result := TBitMap;
    end;



  • edited October 2002
    Hi Ricardo,

    Nice, you got errors, but why don't ypou pubish them here?
    try to load a GIF image from file into the BLOB field, what happens then?

    regards,
    Chris Ueberall;
This discussion has been closed.