Microsoft DirectX 8.1 (Visual Basic)

D3DXColorScale

Scales a color value.

D3DXColorScale( _ 
    COut As D3DCOLORVALUE, _ 
    C1 As D3DCOLORVALUE, _ 
    s As Single)

Parameters

COut
A D3DCOLORVALUE type that is the result of the operation, the scaled color value.
C1
A source D3DCOLORVALUE type.
s
Scale factor. It scales the color, treating it like a 4-D vector. There are no limits on the value of s. If s is 1, the resulting color is the original color.

Error Codes

If the function fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
D3DERR_OUTOFVIDEOMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

This function computes the scaled color value by multiplying the color components of the D3DCOLORVALUE type by the specified scale factor, as shown in the following example.

    Cout.r = C1.r * s

See Also

D3DXColorLerp, D3DXColorModulate, D3DXColorNegative