颜色取反

COLORREF   crSrc   =   ....;  
  COLORREF   crDst   =   0x00ffffff-crSrc;  
  Top

2 楼xxhfortrue(红叶)回复于 2004-07-28 11:25:21 得分 5

同意楼上Top

3 楼ShaftWhy(归去来兮)回复于 2004-07-28 11:29:00 得分 5

AgreeAgreeTop

4 楼holyeagle(一杯清茶)回复于 2004-07-28 11:30:51 得分 10

自己转  
  COLORREF   RGB   =   dc.GetPexel()   |   0x00FFFFFF;   //避免高位出错。  
  COLORREF   RGBRev   =   0x00ffffff   -   RGB;Top

5 楼jennifergiant(希罗·尤尔)回复于 2004-07-28 11:36:40 得分 5

同上 精辟Top

6 楼happyparrot(快乐鹦鹉)回复于 2004-07-28 11:38:34 得分 20

补充一下,如果你只有各个分色的值,比如R,G,B,那么反色等于:  
  COLORREF   ref   =   RGB(255-R,255-G,255-B);  
  或者ref   =   0x00ffffff   -   RGB(R,G,B);Top

7 楼FengYuanMSFT((6.4 被封杀)袁峰 http://fengyuancom.spaces.live.com)回复于 2004-07-28 11:48:11 得分 5

First   you   have   to   define   what   is   a   reverse   color.   Reverse   is   always   relative   to   an   operation   and   a   constant.  
   
  What   you   guys   are   using   is   finding   c'   for   c   such   that   c   +   c'   =   white,   so   '+'   is   the   operation.  
   
  But   reverse   could   also   be   defined   by   finding   c'   for   c   such   that   c   XOR   c'   =   white,   so   'XOR'   is   the   operation   here.

posted @ 2009-11-30 14:01  kevinzhwl  阅读(740)  评论(0编辑  收藏  举报