trichview.com

trichview.support




Re: Send formated text from a RichViewEdit to a String ???


Return to index


Author

Message

Sergey Tkachenko

Posted: 01/02/2004 14:23:33


Copying via stream:


// init

Stream := TMemoryStream.Create;

// saving

rvsource.SaveRVFToStream(Stream, False);

// loading

Stream.Position := 0;

rvdest.LoadRVFFromStream(Stream);

rvdest.Format;

// done

Stream.Free;



The same via String:


// saving

Stream := TMemoryStream.Create;

rvsource.SaveRVFToStream(Stream, False);

SetLength(str, Stream.Size);

Stream.Position := 0;

Stream.ReadBuffer(PChar(str)^, Length(str));

Stream.Free;


// loading

Stream := TMemoryStream.Create;

Stream.WriteBuffer(PChar(str)^, Length(str));

Stream.Position := 0;

rvdest.LoadRVFFromStream(Stream);

rvdest.Format;

Stream.Free;


Warning: this string will contain some binary data, so it cannot be

saved/loaded in text files.


PS: Happy New Year


>

> Hi ! for a mini chat project i try to integrate formated txt (in RVT

format

> bya exemple) in a string, for put it in a another RichView (for a chat

dialogue

> with formating text,color,size options ...)

>

> Thanks !! And Happy New Year to all :)

>

> ps : sorry for my realy poor english ... :|

>





Powered by ABC Amber Outlook Express Converter