LoadRVFFromStream into a table cell does not load backround

General TRichView support forum. Please post your questions here
Post Reply
csoftlab
Posts: 2
Joined: Mon Mar 06, 2006 4:18 pm

LoadRVFFromStream into a table cell does not load backround

Post 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?
csoftlab
Posts: 2
Joined: Mon Mar 06, 2006 4:18 pm

Re: LoadRVFFromStream into a table cell does not load backround

Post 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;
Post Reply