Typing RGB values in the Red, Green, and Blue edit controls.Moving the cursor in the color spectrum control and the luminosity slide control.If the full version of the Color dialog box is open, the user can create a custom color by one the following methods: When you create a Color dialog box, you must use the lpCustColors member of the CHOOSECOLOR structure to specify the initial values for the 16 custom colors. The custom colors are those that you specify or that the user creates. For example, a VGA driver displays 48 colors, and a monochrome display driver displays only 16. The actual number of colors displayed is determined by the display driver. The basic colors represent a selection of the colors available on the specified device. To prevent the user from creating custom colors, you can set the CC_PREVENTFULLOPEN flag to disable the Define Custom Colors button. You can direct the Color dialog box to always display the full version by setting the CC_FULLOPEN flag in the Flags member of the CHOOSECOLOR structure. The user can click this button to display the full version. The partial version of the Color dialog box includes a Define Custom Colors button. The partial version has controls that display the basic and custom color palettes from which the user can select a color value. The full version includes the basic controls and has additional controls that allow the user to create custom colors. The Color dialog box has a full version and a partial version of the user interface. Color Models Used by the Color Dialog Box.To enable a hook procedure for the Color dialog box.To provide a custom template for the Color dialog box.The following subjects are covered in this section To determine the cause of the error, call the CommDlgExtendedError function to retrieve the extended error value. If the user cancels the Color dialog box or an error occurs, ChooseColor returns FALSE and the rgbResult member is not defined. Use the GetRValue, GetGValue, and GetBValue macros to extract individual colors from an RGB color value. The individual values range from 0 through 255. The RGB color value specifies the intensities of the individual red, green, and blue colors that make up the selected color. The rgbResult member of the CHOOSECOLOR structure contains the RGB color value of the color selected by the user. If the user clicks the OK button, ChooseColor returns TRUE. The following illustration shows the full user interface version of the Color dialog box. For example, you can display either a full or partial user interface version of the dialog box. By setting different parameter values for the CHOOSECOLOR structure, you can affect how the Color dialog box appears. You create and display a Color dialog box by initializing a CHOOSECOLOR structure and passing the structure to the ChooseColor function. The Color dialog box returns the RGB value of the color selected by the user. Alternatively, the user can generate a color value by modifying the RGB or hue, saturation, luminosity (HSL) color values of the dialog box user interface. The user can choose a color from either a set of basic or custom color palettes. Displays a modal dialog box that allows the user to choose a specific color value.
0 Comments
Leave a Reply. |