typedef struct tagPALETTEENTRY { // pe 
    BYTE peRed; 
    BYTE peGreen; 
    BYTE peBlue; 
    BYTE peFlags; 
} PALETTEENTRY; 结构中有peFlags,其中之一的值是:PC_NOCOLLAPSE:Specifies that the color be placed in an unused entry in the system palette instead of being matched to an existing color in the system palette. If there are no unused entries in the system palette, the color is matched normally. Once this color is in the system palette, colors in other logical palettes can be matched to this color.我大体理解这里的意思,但始终不是很清楚。1、上面提到的“matched normally”是什么意思?
2、还有一句话“windows保留了一个有20种颜色的内部系统调色板,当逻辑调色板在选取并实现时,一般都会被改变颜色表项的次序”,怎么理解?(一般来说,20种颜色在调色板的前20个索引吧?这里改变颜色表项次序是什么意思?)

解决方案 »

  1.   

    现在知道点了,如下:PC_EXPLICIT:logical palette的条目(pered,pegreen,peblue,peflag)中,低字节用于指定系统调色板 索引(即:pered来指定)将pegreen,peblue设置为零。
    PC_NOCOLLAPSE:使用系统调色板中未使用的条目来映射逻辑调色板中的颜色,如果不匹配,如果系统调色板中的条目都被使用(即:超过256),则进行匹配,最佳匹配
    PC_RESERVED:防止其他窗口的逻辑调色板来匹配指定的系统调色板,从而在改变某个调色时(realize的时候),避免其他应用程序来改变自己的颜色(即:不处理WM_PALETTECHANGED消息)
      

  2.   

    【新手】调色板的类型有啥区别?
    #define POPULARITY_PALETTE 0
    #define MEDIAN_CUT_PALETTE 1
    #define FIXED_PALETTE 2