Page 1 of 1

Saving Page Background

Posted: Sun Nov 13, 2005 10:41 pm
by Splinter
Hi,

I have two ways to change the RVE background. Either RVE.Color or RVE.Backgroundbitmap.

However, to save storage space (I'm saving to database) I don't want to save the Backgroundbitmap with the RVF file (I want to use a link to external file as most backgrounds will be the same), but I DO want to save any change to RVE.Color.

It looks like both of these are saved if RVE.RVFOptions.rvfoSaveBack and rvfoLoadBack are True, but neither are saved if set to false.

Is there any way I can save the background color but not the image? (I'll use my own code to save a link to the background image file, probably in docproperties)

Also, I've noticed if rvfoSaveBack and rvfoLoadBack are true, sometimes assigning RVE.Backgroundbitmap does not work, the background just does not take, but if they are both false it works everytime. Any thoughts on this?

Thanks

Posted: Mon Nov 14, 2005 9:11 pm
by Sergey Tkachenko
May be you can save background color externaly, just like a link to background image?

About not-saving background properties in database: call DBRichViewEdit.CanChange before and DBRichViewEdit.Change after modifying the background properties.

Posted: Mon Nov 14, 2005 9:22 pm
by Splinter
Thanks Sergey,

I had thought of doing that, but for my application I would need backward compatibility. So how can I retrieve the RVE.Color of existing documents if rvfoLoadBack is set to false? :?: If there is a way to do that it could solve my problem.

I'm not using DB components (using standard RVE), I have own routine for saving and loading to database via streams, so I don't think .CanChange is required? I'm finding that for some documents that have been loaded when I use the command:

RVE.Backgroundbitmap.loadfromfile(somefile);

For some loaded documents it works fine every time, but for others it is ignored completely, but this only happens if rvfoSaveBack and rvfoLoadBack are true. Weird.

Posted: Wed Nov 16, 2005 11:51 pm
by Splinter
Any thoughts on this?
So how can I retrieve the RVE.Color of existing documents if rvfoLoadBack is set to false? If there is a way to do that it could solve my problem.
Thanks

Posted: Thu Nov 17, 2005 7:08 pm
by Sergey Tkachenko
It's easy.
The first RVF line is always
-8 1 3
If background is present, it's the second line.
The example of this line is
-7 2 0 0 2 0 3 -2147483643
where the first number (-7) means that this is a record about background.
The last two numbers are ord(BackgroundStyle) (3) and background color (-2147483643).