trichview.com

trichview.support




Re: SaveRVFToStream


Return to index


Author

Message

Mounir Brigui

Posted: 04/16/2004 11:39:23


Hi Ryan !


A Stream is already a buffer. Try it directly from Stream to rve, without

using an extra Buffer.



"Ryan" <[email protected]> schrieb im Newsbeitrag

news:[email protected]...

>

> Hi,

> Just trying to copy an RVF stream to a buffer but can't seem to make it

work.

> Looks as though i am losing some data when going from the memory stream to

> the buffer, just wondering if you know what the problem is or how i can

achieve

> this.

> My code is as follows:

>

> procedure TForm1.Button1Click(Sender: TObject);

> var

>  Stream : TMemoryStream;

>  Buffer : PChar;

> begin

>   Stream := TMemoryStream.Create;

>   Stream.Position := 0;

>   rve.SaveRVFToStream( Stream , false );

>   Stream.Position := 0;

>   GetMem( Buffer , Stream.Size );

>   Stream.ReadBuffer( Buffer^ , Stream.size );

>   Stream.clear;

>   Stream.Position := 0;

>   Stream.WriteBuffer( Buffer^ , length( Buffer ));

>   rve.Clear;

>   rve.Format;

>   rve.LoadRVFFromStream(Stream);

>   rve.Format;

>   Stream.free;

>   FreeMem( Buffer );

> end;

>

> Thanks.





Powered by ABC Amber Outlook Express Converter