trichview.com

trichview.support




Re: Using name for BackgroundImage / Table / Cells


Return to index


Author

Message

Mirko Görgen

Posted: 01/23/2005 15:56:18


Thanks this works well


Last question how do I clear the picture again?


will this be enough?


table->Cells[r][c]->BackgroundImage = NULL;

table->Cells[r][c]->BackgroundImageFileName = "";


regards

Mirko


"Sergey Tkachenko" <svt@trichview.com> wrote:

>Make sure that you use the last version of RVXML. It should save and load

>background images for tables.

>

>Important note:

>There is a difference in inserting pictures in document and using them as

>background images.

>When you insert picture, it's owned by trichview and should not be freed.

>But when you assign it to background, it's only copied.

>

>So the code should be:

>

>TGraphic* gr = new TJPEGImage;

>gr->LoadFromFile("C:\\editor\\img\\pic.jpg");

>table->Cells[r][c]->BackgroundImage = gr;

>table->Cells[r][c]->BackgroundStyle  = rvbsTiled;

>delete gr;

>

>or

>

>TPicture *pic = new TPicture;

>pic->LoadFromFile("C:\\editor\\img\\pic.jpg");

>table->Cells[r][c]->BackgroundImage = pic->Graphic;

>table->Cells[r][c]->BackgroundStyle  = rvbsTiled;

>delete pic;

>

>Now, to your question.

>

>There are special places to store image file names.

>For items (images and tables), it can get/set as a value of

>rvespImageFileName extra string property (see the help file on

>TRVExtraItemStrProperty).

>For table cells, it can be accessed as cell.BackgroundImageFileName.

>

>rvespImageFileName is a special property, it's not an item text which can

be

>set as the first parameter of InsertPicture/InsertItem. This property must

>be get/set by the special methods.

>

>Unfortunately, this property was added after RVXML was designed, so the

>implementation of these properties may be incomplete in it (but it

>definitely presents there)

>

>

>>

>> Hi

>>

>> For inserting Pictures to RVE I use s.th. like

>>

>> String dbname = "picname"

>> RichViewEdit1->InsertPicture(dbname,gr,rvvaBaseline);

>>

>> which works quite well

>>

>> I now want to use s.th. simular for inserting BackgroundImage to Table

>Cell.

>>

>> The Code so far is

>>

>> TGraphic* gr = NULL;

>> gr = new TJPEGImage;

>> TPicture *pic = new TPicture;

>> if(gr) {

>> pic->LoadFromFile("C:\\editor\\img\\pic.jpg");

>> gr->Assign(pic->Graphic);

>> table->Cells[r][c]->BackgroundImage = gr;

>> table->Cells[r][c]->BackgroundStyle  = rvbsTiled;

>>

>> ..

>>

>> The Code works, image is on the right place, but no possibilty to set

a

>name.

>>

>>

>> I need this because I use RVXML to produce XML and html, wich also works

>> quite perfect so far(After fixing some poor XML output ;-)

>>

>> By the way, could it be that RXML doesn´t notice BackgroundImage of Cells?

>> But I guess this could be not to diffcult to fix this sympton.

>>

>> So any idea for my problem?

>>

>> regards

>> Mirko

>

>





Powered by ABC Amber Outlook Express Converter