S searoom Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-10 #1 想使用一函数实现颜色取反的功能,不知道该怎么实现!
A andy263 Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-10 #2 换算rgb 然后r:=255-r g:=255-g b:=255-b
Z zhbj Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-10 #3 首先分解颜色值 function colortohex(cc:Tcolor):string begin result:=inttohex(colortorgb(cc),6) ; result:=copy(result,5,2)+copy(result,3,2)+copy(result,1,2) ; End ; 得到 R,G ,, B 用 255 减去 ,然后再用 RGB((255-r), ..., ..)
首先分解颜色值 function colortohex(cc:Tcolor):string begin result:=inttohex(colortorgb(cc),6) ; result:=copy(result,5,2)+copy(result,3,2)+copy(result,1,2) ; End ; 得到 R,G ,, B 用 255 减去 ,然后再用 RGB((255-r), ..., ..)
O oiwin Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-26 #4 newcolor:=oldcolor xor $FFFFFF 这比较简单,效率高!
J jackchin Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-26 #6 255 - 的方法和 xor 的方法显然是结果不同的, 到底哪个对 ?
A apw Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-26 #7 对于正整数,减和异或结果是一样的。 function GetReverseColor(c:TColor):TColor; begin Result := RGB(255-GetRValue(C), 255-GetGValue(C), 255-GetBValue(C)); end;
对于正整数,减和异或结果是一样的。 function GetReverseColor(c:TColor):TColor; begin Result := RGB(255-GetRValue(C), 255-GetGValue(C), 255-GetBValue(C)); end;