Page 1 of 1

LoadRVFFromStream into a table cell does not load backround

Posted: Mon Aug 26, 2024 8:33 pm
by csoftlab
Hello Sergey,
I have RichViewEdit1 and RichViewEdit2 on a form. One contains some text with a background image (or a background color). The other contains a table with several cells.
I need to copy full RichViewEdit1 content into a table cell of RichViewEdit2.
I use this code:

Code: Select all

		TStream* Stream = new TMemoryStream;
		RichViewEdit1->SaveRVFToStream(Stream, false);
		TRVLayoutInfo * ALayout = RichViewEdit1->CreateLayoutInfo();
		TColor AColor = RichViewEdit1->Color;
		TRVBackground *ABackGround = RichViewEdit1->Background;
		Stream->Position = 0;
		table->Cells[j][i]->LoadRVFFromStream(Stream, AColor, ABackGround, ALayout, NULL, NULL);
		delete ALayout;
		delete Stream;
Unfortunately, this code does not load a background picture or a color from RichViewEdit1 into a cell. Could you help?

Re: LoadRVFFromStream into a table cell does not load backround

Posted: Mon Aug 26, 2024 8:58 pm
by csoftlab
Seems I've found a solution.

Code: Select all

		table->Cells[j][i]->Color = RichViewEdit1->Color;
		table->Cells[j][i]->BackgroundImage = RichViewEdit1->Background->Bitmap;
		table->Cells[j][i]->BackgroundStyle = RichViewEdit1->Background->ItemBackStyle;