Hello,
In RichViewEdit I have a text with an image loaded from HTML (through RvHtmlImporter). I want to mark a part of the text with this image and load it to another RichViewEdit object.
I am doing it like this:
In the second RichViewEdit object only the text appears, a space instead of image. Using InsertRVFFromStream gives the same result. Could you help me in finding a solution?[/code]
Thank you very much,
Actually the problem was much more simply and stupid. The option rvfoSavePictureBody was not enabled - my fault.
I hava another problem. I have 2 RichViewEdit objects and want to copy a part of the text, with images, from RVE1 to RVE2. The text which I am copying from RVE1 is written in green font but after inserting to RVE2 it changes to black. I worked it around by selecting what was inserted and use the function ApplyTextStyle, but probably there is a better solution. Is it possible to keep the style of inserted text. I am using the following code:
//TransStream is defined as TMemoryStream*
RichViewEdit1->SaveRVFToStream(TransStream, false);
//The text in RichViewEdit1 is green
TransStream->Position = 0;
RichViewEdit2->InsertRVFFromStreamEd(Form2->TransStream);
//The text inserted is black (default style)
Right click RichViewEdit1 in IDE. Choose "Settings" in the context menu. Select "Allow adding styles dynamically".
The same for RichViewEdit2.
(actually, these options must be set by default for RichViewEdits placed on a form at design time; if you create them in code, you need to set properties manually).
Also, make sure that the both editors are linked to their own RVStyle components.