Copyright © 2002-2009 MultiMedia Soft 
Return to index  
 
SURFACE_COLOR_DESC structure 
 
The SURFACE_COLOR_DESC structure contains all the information about the color settings of a certain element of the button surface.  
Visual C++ definition 
typedef struct {  
COLORREF  color
short     nGradientFactor
short     nRender3D
short     nGradientType
COLORREF  color2
} SURFACE_COLOR_DESC;  
 
Visual Basic definition 
Public Type SURFACE_COLOR_DESC 
color As OLE_COLOR 
nGradientFactor As Integer 
nRender3D As Integer 
nGradientType As Integer 
color2 As OLE_COLOR 
End Type 
 
Member
Description
 
 
color
Color expressed in RGB of the button surface element.
nGradientFactor
The factor used to calculate the 3D gradient applied to the color. 
The value can be in the range from 1 to 6: the higher is the value the darker will appear the button surface. 
Here follows a set of identical buttons whose only difference is the nGradientFactor field value that is displayed over the button surface. 
  
 
nGradientType
The type of gradient algorithm used for 3D rendering the button surface. Note that the point of maximum light exposures depends upon the value of the LightDirection property. 
Supported values are the following: 
Mnemonic constant
Value
Meaning
COLOR_GRADIENT_CLASSIC
0
A circular gradient algorithm. 
COLOR_GRADIENT_LINEAR
1
A linear gradient algorithm 
nRender3D
The 3D color rendering of the button surface. 
Mnemonic constant
Value
Meaning
COLOR_RENDER_BEST_MATCH
0
Best color match: Uses exactly the color set by the color parameter to make the 3D rendering. With some colors (for example YELLOW RGB (255, 255, 0)) the 3D rendering is very bad due to our eye's perception of the color itself: in this cases it is convenient to use Best 3D rendering. 
In all of the samples below the color field is set to Orange RGB (255, 128, 0)  
COLOR_RENDER_BEST_3D
1
Best 3D rendering: Uses another coloring algorithm to avoid the problem described above; the result is generally a darker button. 
COLOR_RENDER_LINEAR_MATCH
2
Linear color match: uses another coloring algorithm. 
COLOR_RENDER_HYPER_3D
3
Hyper 3D rendering: uses an extended 3D gradient algorithm. 
COLOR_RENDER_2_COLORS
4
Bicolor: uses a gradient algorithm that makes use of two colors. 
In the the sample below the color field is set to Orange RGB (255, 128, 0) and the color2 field is set to Blue RGB (0, 0, 255)  
color2
The secondary RGB color used for calculating the gradient 3D rendering when the nRender3D field is set to COLOR_RENDER_2_COLORS. 
In the sample below you can see a button using two colors for its 3D rendering: red is the primary color (set through the color field) and blue is the secondary color. 
 
 
 
 
 
 
 
Copyright © 2002-2009 MultiMedia Soft 
Return to index