gpt4 book ai didi

.net - 为什么 Color.FromArgb(255, 255, 255, 255) != Color.White?

转载 作者:行者123 更新时间:2023-12-03 21:34:15 24 4
gpt4 key购买 nike

为什么 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com