trichview.support
Re: Send formated text from a RichViewEdit to a String ??? |
Author |
Message |
Souch |
Posted: 01/03/2004 1:01:59 Hi, and thanks for your quickly answer :-) the use of this part of code is for a tcp/ip chat. i want to transfert the contents of the TRichEdit (with text formating) into a string (for send the all by a writeln (indy idtcpCLient/idtcpserver)) ... Your second solution is working but it is not very estetic tu type into a simple edit without direct text formating, do you understand ? Thanks Souch. Ps : Sorry for my poor english.... :-| "Sergey Tkachenko" <svt@trichview.com> a écrit dans le message de news: 3ff561f9@support.torry.net... > 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