Platform SDK: DirectX

Using Color Controls

[C++]

You set and retrieve surface color controls through the IDirectDrawColorControl interface, which can be retrieved by querying the DirectDrawSurface object using the IID_IDirectDrawColorControl reference identifier.

Color control information is represented by a DDCOLORCONTROL structure, which is used with both methods of the interface, IDirectDrawColorControl::SetColorControls and IDirectDrawColorControl::GetColorControls. The first structure member, dwSize, should be set to the size of the structure, in bytes, before you use it. How you use the next member, dwFlags, depends on whether you are setting or retrieving color controls. If you are setting new color controls, set dwFlags to a combination of the appropriate flags to indicate which of the other structure members contain valid data that you've set. However, when retrieving color controls, you don't need to set the dwFlags before using it—it will contain flags telling you which members are valid after the IDirectDrawColorControl::GetColorControls method returns.

The remaining DDCOLORCONTROL structure members can contain values that describe the brightness, contrast, hue, saturation, sharpness, gamma, and whether color is used. Note that the structure contains information about gamma correction. This is a single gamma value that affects overall brightness, and it should not be confused with the gamma adjustment features provided through the IDirectDrawGammaControl interface.

[Visual Basic]

You set and retrieve surface color controls through the DirectDrawColorControl object, which can be retrieved by calling DirectDrawSurface7.GetDirectDrawColorControl.

Color control information is represented by a DDCOLORCONTROL type, which is used with both methods of the object, DirectDrawColorControl.SetColorControls and DirectDrawColorControl.GetColorControls.

The DDCOLORCONTROL type members can contain values that describe the brightness, contrast, hue, saturation, sharpness, gamma, and whether color is used. Note that the structure contains information about gamma correction. This is a single gamma value that affects overall brightness, and it should not be confused with the gamma adjustment features provided through the DirectDrawGammaControl object.