Results 1 to 2 of 2

Thread: LoadFrom/SaveTo Stream Error

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    LoadFrom/SaveTo Stream Error

    Hi All

    Can anyone tell me why this code doesn't work...

    [pascal]
    procedure TForm1.FormCreate(Sender: TObject);
    Var
    Stream : TMemoryStream;
    begin
    Application.OnIdle := Form1.GameLoop;
    Item := TGLXImageItem.Create(Nil);
    Item.LoadTexture('C:\CairnsGames\Games\DGDev\GLXTr eem\Hut.bmp');
    Item.TransparentColor := $FFFFFF;
    Item.Transparent := True;
    Item2 := TGLXImageItem.Create(Nil);
    Stream := TMemoryStream.Create;
    Item.SaveToStream(Stream);
    Item2.LoadFromStream(Stream);
    Stream.Free;
    end;
    [/pascal]

    The Line 'Item2.LoadFromStream(Stream);' gives me a 'Stream read Error'.

    [size=7px]Also posted on the GLXtreem Forum.[/size]
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  2. #2
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    LoadFrom/SaveTo Stream Error

    Andreaz posted an answer on the GLXTreem site.

    I need to seek to start of stream before reading out of it.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •