为什么 Color.FromArgb(255, 255, 255, 255) 是 不是 等于 Color.White ?是否有任何内置方法可以只比较 A、R、G、B 值而不是颜色名称?
谢谢。
最佳答案
见 http://msdn.microsoft.com/en-us/library/e03x8ct2(VS.85).aspx
This structure only does comparisons with other Color structures. To compare colors based solely on their ARGB values, you should use the ToArgb method. This is because the Equals and op_Equality members determine equivalency using more than just the ARGB value of the colors. For example, Black and FromArgb(0,0,0) are not considered equal, since Black is a named color and FromArgb(0,0,0) is not.
关于.net - 为什么 Color.FromArgb(255, 255, 255, 255) != Color.White?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4195134/