DG Kernel Documentation


Skip Navigation Links.
Skip Navigation LinksHome Page > API Reference > View > IRectangleColor_KC Search Documentation


IRectangleColor_KC Interface

SetStockStyle
SetColorCount
GetColorCount
SetColor
GetColor

IRectangleColor_KC is implemented by DG Kernel component to give access to the set of colors assigned to edge of the window of the component. The set is used to define gradient background.

The SetStockStyle method simplifies manipulation of the color scheme by using a number of predefined styles.

Sides of the window are numbered in Counter Clock Wise direction as follows: 0- bottom, 1-right, 2-top, 3-left. Corners are assumed to belong to the first end of the side, So corner 0 is the bottom left corner and corner 3 is the top left corner. Each side has a separate array of lights of size at least 1 located at arbitrary points along the side. The first color (index 0) must be located at the corner.

Location of a color on a side is specified with a float number in range [0, 1) (1 not included). Location 0 is location at the corner (the first end of the side). Location 0.5 is at the middle of the side.

By default all colors have (0.8, 1, 0.8) RGB components

Query path: DG Kernel > GetView > IView > IRectangleColor_KC

See also Background, DIView sample


HRESULT SetStockStyle(int style, Color_KC* color0, Color_KC* color1)

Parameters

style - [in] index of the style. Valid values: 0 through to 9

color0, color1 - [in] Colors used in the style.

Remarks:

This method simplifies manipulation of the color scheme by using a number of predefined styles. Valid styles are:

0 - Horizontal gradient
1 - Vertical gradient
3 - 5 - color1 at corner 0 through to 3
6 - Horizontal gradient 2/3 of color1
7 - Vertical gradient 2/3 of color1
8 - Horizontal gradient 1/3 of color1
9 - Vertical gradient 1/3 of color1

HRESULT SetColorCount(int side, int count)

Parameters

side - [in] index of the side. Valid values: 0,1,2,3

count - [in] New size of the color array on the side. Must be greater than 0.

Remarks:

The method changes size of the color array of the side. count must be greater than 0, so that all four corners have always an assigned color. New colors are created with (0.8, 1, 0.8) RGB components.


HRESULT GetColorCount(int side, int* count)

Parameters

side - [in] index of the side. Valid values: 0,1,2,3

 count - [out] The returned size of the color array on the side

Remarks:

The method returns size of the color array of the side


HRESULT SetColor(int side, int index, float location, Color_KC* color)

Parameters

side - [in] index of the side. Valid values: 0,1,2,3

 index - [in] index of the color to be modified. Must be greater or equal to 0 and less than size of the array

 location - [in] location of the color on the side. See description on the top of the page

color - [in] Components of the color

Remarks:

Modifies location and components of index-th color in the array of the side.  See description on the top of the page


HRESULT GetColor(int side, int index, float* location, Color_KC* color)

Parameters

side - [in] index of the side. Valid values: 0,1,2,3

 index - [in] index of the color to be modified. Must be greater or equal to 0 and less than size of the array

 location - [out] location of the color on the side. See description on the top of the page

color - [out] Components of the color

Remarks:

Returns location and components of index-th color in the array of the side.  See description on the top of the page