java对rgb取反_颜色取反 - kevinzhwl - 博客园

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值