VpeSetRTFColor

<< Click to Display Table of Contents >>

Navigation:  RTF Functions >

VpeSetRTFColor

Previous pageReturn to chapter overviewNext page

Modify the build-in RTF color table.

void VpeSetRTFColor(

VpeHandle hDoc,

int ID,

COLORREF color

)

VpeHandle hDoc

Document Handle

int id

the entry ID

COLORREF color

one of the predefined "COLOR_xyz" constants described in Programmer's Manual or any RGB value that shall be assigned to the given entry-id

Remarks:

RTF offers no way to set a transparent background mode, like VPE does. So we decided to set the background mode to transparent, in that case you use COLOR_WHITE = RGB(255, 255, 255) as background color.

 

VPE has build-in a predefined color table:

color1

BLACK

RGB(0, 0, 0)

color2

DKGRAY

RGB(128, 128, 128)

color3

GRAY

RGB(192, 192, 192)

color4

LTGRAY

RGB(230, 230, 230)

color5

WHITE

RGB(255, 255, 255)

color6

DKRED

RGB(128, 0, 0)

color7

RED

RGB(192, 0, 0)

color8

LTRED

RGB(255, 0, 0)

color9

DKORANGE

RGB(255,  64, 0)

color10

ORANGE

RGB(255, 128, 0)

color11

LTORANGE

RGB(255, 192, 0)

color12

DKYELLOW

RGB(224, 224, 0)

color13

YELLOW

RGB(242, 242, 0)

color14

LTYELLOW

RGB(255, 255, 0)

color15

DKGREEN

RGB(0, 128, 0)

color16

GREEN

RGB(0, 192, 0)

color17

LTGREEN  

RGB(0, 255, 0)

color18

HIGREEN

RGB(0, 255, 128)

color19

BLUEGREEN

RGB(0, 128, 128)

color20

OLIVE

RGB(128, 128, 0)

color21

BROWN

RGB(128,  80, 0)

color22

DKBLUE

RGB(0, 0, 128)

color23

BLUE

RGB(0, 0, 255)

color24

LTBLUE

RGB(0, 128, 255)

color25

LTLTBLUE

RGB(0, 160, 255)

color26

HIBLUE

RGB(0, 192, 255)

color27

CYAN

RGB(0, 255, 255)

color28

DKPURPLE

RGB(128, 0, 128)

color29

PURPLE

RGB(192, 0, 192)

color30

MAGENTA

RGB(255, 0, 255)

 

 

Examples:

change color1 with

VpeSetRTFColor(hDoc, 1, RGB(10, 10, 10))

 

Or you can add as many colors to the table as you like, for example:

VpeSetRTFColor(hDoc, 31, RGB(10, 20, 30))

 

See also:

"RTF - Rich Text Format" in the Programmer's Manual