VCGetColorName
VCSetColorName


Version:

5.0

Description:

Sets the color name for a given color index.

Declaration:

 

C/C++

extern "C" int WINAPI VCGetColorName(short* iError, short iIndex, char* szName);
extern "C" void WINAPI VCSetColorName(short* iError, short iIndex, char* szName);

Delphi

function VCGetColorName(var iError: Smallint; iIndex: Smallint; szName: PAnsiChar): Longint; stdcall;
procedure VCSetColorName(var iError: Smallint; iIndex: Smallint; szName: PAnsiChar); stdcall; 

ActiveX/COM

Function GetColorName(ByVal iIndex As Integer) As String

Parameters:

iIndex - the color index from 0 to 255.
szName
- the color name, maximum 32 characters not including the NULL terminator.

Return Value:

If VCGetColorName succeeds, the return value is the number of characters in string, excluding the terminal NULL. If an error occurs, the return value is 0.

iError Code:

0 - Success
1 - Invalid world
2 - Index out of range

Notes:

Visual CADD™ has a customizable pallet of 256 colors that it uses to draw to the screen or printer. This pallet is used for all entity types in all drawings opened during a Visual CADD™ session. These colors are stored as RGB values that are read from the VGA.PAL in the System folder  at program startup. Each pallet entry has an index, a color (RGB value) and an optional name associated with it. Entities and global settings that have a color associated with them store a color index value and not the actual color value or name. Though VCSetColorName allows the color name to be changed, this call only affects the current session of the program. If you want the changes to exist across Visual CADD™ sessions you need to call VCSaveColorPalette.

Calling VCGetColorName with NULL as the szName parameter, will return the number of characters in string, excluding the terminal NULL.

See Also:

VCLoadColorPalette, VCSaveColorPalette, VCGetColorRef, VCSetColorRef, VCGetColorIndex, VCSetColorIndex