用colcodialog得到COLORREF类型的值,怎么转道rgb呢?
就是分别到red,green,blue

解决方案 »

  1.   

    BYTE red,green,blue;         COLORREF   col;
             red=(BYTE) col;
    col=col>>8;
    green=(BYTE)col;
    col=col>>8;
    blue=(BYTE)col;
      

  2.   

    COLORREF
    The COLORREF value is a 32-bit value used to specify an RGB color. Res
    When specifying an explicit RGB color, the COLORREF value has the following hexadecimal form: 0x00bbggrr 
     
    The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF.