Share via


Using Color Controls

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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 have set.

However, when retrieving color controls, you do not 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.