Functions | |
int | mdlColor_convertRGBtoIndex (int screen, RgbColorDef *pColor) |
Obtains an index of the Color Manager's display colors representing the closest match to rgb. More... | |
int | mdlColorDescr_getColorId (int *pColorId, BSIColorDescrCP pCd) |
Used to query a color descriptor for its X Color ID value. More... | |
int | mdlColorDescr_getElemColorNumber (int *pElemColorNumber, BSIColorDescrCP pCd) |
Used to query a color descriptor for its associated element color number. More... | |
int | mdlColorDescr_getHsv (DgnPlatform::HsvColorDef *pHsv, BSIColorDescrCP pCd) |
Used to query a color descriptor for its HSV value. More... | |
int | mdlColorDescr_getMenuColor (int *pMenuColorId, BSIColorDescrCP pCd) |
Used to query a color descriptor for its associated menu color, also known as a "fixed color.". More... | |
int | mdlColorDescr_getRgb (RgbColorDef *pRgb, BSIColorDescrCP pCd) |
Query a color descriptor for its RGB value. More... | |
BSIColorDescrP | mdlColorDescr_getBestBWContrast (int screen, BSIColorDescrCP pCd) |
Returns a pointer to either a black or white color descriptor, whichever provides the best contrast to pCd as a foreground color. More... | |
int | mdlColorDescr_getDrawIndex (int *pDrawIndex, BSIColorDescrCP pColorDescr, int screen) |
Acquire a draw value from a color descriptor for a given screen. More... | |
int | mdlColorDescr_setDrawIndex (BSIColorDescr *pColorDescr, long drawIndex, int screen) |
Used to force a color descriptor to always yield a specific draw value for a given screen. More... | |
int | mdlColorDescr_setByRgb (BSIColorDescr *pColorDescr, RgbColorDef *pRgb, int matchToDgnCtbl) |
Set a color descriptor from the given RGB triad. More... | |
int | mdlColorDescr_setByHsv (BSIColorDescr *pColorDescr, DgnPlatform::HsvColorDef *pHsv, int matchToDgnCtbl) |
Set a color descriptor from an HSV color structure. More... | |
int | mdlColorDescr_setByColorId (BSIColorDescr *pColorDescr, int colorID, int matchToDgnCtbl) |
Set the RGB value of the given color descriptor according to the RGB associated with colorID. More... | |
int | mdlColorDescr_setByColorName (BSIColorDescr *pColorDescr, WCharCP pColorName, int matchToDgnCtbl) |
Used to set the RGB value of the given color descriptor according to the RGB associated with colorName. More... | |
int | mdlColorDescr_setByMenuColor (BSIColorDescr *pColorDescr, int menuColorId) |
Used to set a color descriptor according to the MicroStation defined "menu colors." The menu colors are: BLACK_INDEX, BLUE_INDEX, GREEN_INDEX, CYAN_INDEX, RED_INDEX, MAGENTA_INDEX, YELLOW_INDEX, WHITE_INDEX, LGREY_INDEX, DGREY_INDEX, MGREY_INDEX and PSEUDOWHITE_INDEX. More... | |
int | mdlColorDescr_setByElemColorNumber (BSIColorDescr *pColorDescr, int elemColorNumber) |
Used to set the RGB value of the given color descriptor with the design file colortable RGB indexed by elemColorNumber. More... | |
int mdlColor_convertRGBtoIndex | ( | int | screen, |
RgbColorDef * | pColor | ||
) |
Obtains an index of the Color Manager's display colors representing the closest match to rgb.
[in] | screen | Indicates the right (0) or left (1) screen. |
[in] | pColor | Is the color definition to match against the Color Manager's display colors. |
BSIColorDescrP mdlColorDescr_getBestBWContrast | ( | int | screen, |
BSIColorDescrCP | pCd | ||
) |
Returns a pointer to either a black or white color descriptor, whichever provides the best contrast to pCd as a foreground color.
[in] | screen | Indicates the screen being drawn to. |
[in] | pCd | Is a color descriptor pointer for the background color. |
int mdlColorDescr_getColorId | ( | int * | pColorId, |
BSIColorDescrCP | pCd | ||
) |
Used to query a color descriptor for its X Color ID value.
Valid X Color ID values are defined in colrname.r.h.
[out] | pColorId | Points to an integer that is to receive the color ID. |
[in] | pCd | Is a color descriptor pointer usually obtained from a MicroStation color palette using the mdlColorPal_getColorDescr function. |
int mdlColorDescr_getDrawIndex | ( | int * | pDrawIndex, |
BSIColorDescrCP | pColorDescr, | ||
int | screen | ||
) |
Acquire a draw value from a color descriptor for a given screen.
This function rarely needs to be called from MDL applications since drawing routines accept pointers to color descriptors directly. MicroStation uses this function internally to obtain the draw values contained in color descriptors.
[out] | pDrawIndex | Is the address of a memory location to receive the draw value. Depending on the hardware/operating system platform, the draw value will be a video hardware pixel index or the native operating system's equivalent type. |
[in] | pColorDescr | is the color descriptor from which drawValueP will be obtained. |
[in] | screen | indicates the screen for which pDrawValue will be obtained. |
Error Code | Reason |
---|---|
MDLERR_BADSCREENNUMBER | Invalid screen parameter |
MDLERR_BADCOLORDESCR | pColorDescr is not valid |
int mdlColorDescr_getElemColorNumber | ( | int * | pElemColorNumber, |
BSIColorDescrCP | pCd | ||
) |
Used to query a color descriptor for its associated element color number.
[out] | pElemColorNumber | Is a pointer to an integer to receive the element color number. |
[in] | pCd | Is a color descriptor pointer usually obtained from a MicroStation color palette using the mdlColorPal_getColorDescr function. |
int mdlColorDescr_getHsv | ( | DgnPlatform::HsvColorDef * | pHsv, |
BSIColorDescrCP | pCd | ||
) |
Used to query a color descriptor for its HSV value.
[out] | pHsv | Points to an HSV variable to receive the HSV data. |
[in] | pCd | Is a color descriptor pointer usually obtained from a MicroStation color palette using the mdlColorPal_getColorDescr function. |
int mdlColorDescr_getMenuColor | ( | int * | pMenuColorId, |
BSIColorDescrCP | pCd | ||
) |
Used to query a color descriptor for its associated menu color, also known as a "fixed color.".
[out] | pMenuColorId | Points to an integer that is to receive the color ID. |
[in] | pCd | Is a color descriptor pointer usually obtained from a MicroStation color palette using the mdlColorPal_getColorDescr function. |
int mdlColorDescr_getRgb | ( | RgbColorDef * | pRgb, |
BSIColorDescrCP | pCd | ||
) |
Query a color descriptor for its RGB value.
[out] | pRgb | Points to an RGB variable to receive the RGB data. |
[in] | pCd | Is a color descriptor pointer usually obtained from a MicroStation color palette using the mdlColorPal_getColorDescr function. |
int mdlColorDescr_setByColorId | ( | BSIColorDescr * | pColorDescr, |
int | colorID, | ||
int | matchToDgnCtbl | ||
) |
Set the RGB value of the given color descriptor according to the RGB associated with colorID.
[out] | pColorDescr | Points to the color descriptor to receive the new setting. |
[in] | colorID | Is one of the color ID macros defined in colrname.r.h and indicates (indirectly) the RGB value to set in cdP. |
[in] | matchToDgnCtbl | Controls how the draw value for cdP is calculated. If matchToDgnCtbl is true, the draw value will correspond to the closest RGB in the attached colortable. If matchToDgnCtbl is false, the draw value will correspond to the closest RGB in the video hardware. This parameter is usually set to false. |
int mdlColorDescr_setByColorName | ( | BSIColorDescr * | pColorDescr, |
WCharCP | pColorName, | ||
int | matchToDgnCtbl | ||
) |
Used to set the RGB value of the given color descriptor according to the RGB associated with colorName.
[out] | pColorDescr | Points to the color descriptor to receive the new setting. |
[in] | pColorName | Is an ASCII color name which is contained in one of the standard MicroStation color name stringlists. The string is located in the stringlists and its associated RGB value is saved. This RGB value will be used to set the color descriptor. |
[in] | matchToDgnCtbl | Controls how the draw value for cdP is calculated. If matchToDgnCtbl is true, the draw value will correspond to the closest RGB in the attached colortable. If matchToDgnCtbl is false, the draw value will correspond to the closest RGB in the video hardware. This parameter is usually set to false. |
int mdlColorDescr_setByElemColorNumber | ( | BSIColorDescr * | pColorDescr, |
int | elemColorNumber | ||
) |
Used to set the RGB value of the given color descriptor with the design file colortable RGB indexed by elemColorNumber.
[out] | pColorDescr | Points to the color descriptor to receive the new setting. |
[in] | elemColorNumber | Is an index into the currently attached master design file colortable, or the MicroStation default colortable if no colortable is attached. |
int mdlColorDescr_setByHsv | ( | BSIColorDescr * | pColorDescr, |
DgnPlatform::HsvColorDef * | pHsv, | ||
int | matchToDgnCtbl | ||
) |
Set a color descriptor from an HSV color structure.
The HSV data is stored internally to the color descriptor as RGB data.
[out] | pColorDescr | Points to a color descriptor to receive the setting. |
[in] | pHsv | Points to the HSV data. This data will be converted to RGB and used to set the color descriptor. |
[in] | matchToDgnCtbl | Controls how the draw value for cdP is calculated. If matchToDgnCtbl is true, the draw value will correspond to the closest RGB in the attached colortable. If matchToDgnCtbl is false, the draw value will correspond to the closest RGB in the video hardware. This parameter is usually set to false. |
int mdlColorDescr_setByMenuColor | ( | BSIColorDescr * | pColorDescr, |
int | menuColorId | ||
) |
Used to set a color descriptor according to the MicroStation defined "menu colors." The menu colors are:
BLACK_INDEX,
BLUE_INDEX,
GREEN_INDEX,
CYAN_INDEX,
RED_INDEX,
MAGENTA_INDEX,
YELLOW_INDEX,
WHITE_INDEX,
LGREY_INDEX,
DGREY_INDEX,
MGREY_INDEX and
PSEUDOWHITE_INDEX.
[out] | pColorDescr | Points to a color descriptor to receive the setting. |
[in] | menuColorId | Is one of the menu color IDs (shown above) defined in msdefs.h. |
int mdlColorDescr_setByRgb | ( | BSIColorDescr * | pColorDescr, |
RgbColorDef * | pRgb, | ||
int | matchToDgnCtbl | ||
) |
Set a color descriptor from the given RGB triad.
[out] | pColorDescr | Points to a color descriptor to receive the setting. |
[in] | pRgb | Points to the RGB data that is used to set the color descriptor. |
[in] | matchToDgnCtbl | Controls how the draw value for cdP is calculated. If matchToDgnCtbl is true, the draw value will correspond to the closest RGB in the attached colortable. If matchToDgnCtbl is false, the draw value will correspond to the closest RGB in the video hardware. This parameter is usually set to false. |
int mdlColorDescr_setDrawIndex | ( | BSIColorDescr * | pColorDescr, |
long | drawIndex, | ||
int | screen | ||
) |
Used to force a color descriptor to always yield a specific draw value for a given screen.
(A color descriptor "yields" a draw value when queried by the function mdlColorDescr_getDrawIndex). It is up to the caller to maintain this draw value as the MicroStation color environment changes. This function is not recommended for general use. Instead, use one of the mdlColorDescr_setBy... routines to set color descriptors since this will allow MicroStation to maintain the draw values automatically.
[out] | pColorDescr | Points to a color descriptor to receive the setting. |
[in] | drawIndex | Specifies the draw value to store in the color descriptor. |
[in] | screen | Indicates for which screen the color descriptor will yield drawIndex when queried by mdlColorDescr_getDrawIndex. |