将旧的 VB6 QBColor 函数转换为 C#
我正在用 C# 重写 VB6 程序,VB 程序使用 QBColor
函数
http://msdn.microsoft.com/en-us/library/d2dz8078(v=VS.80).aspx 它指出哪个数字等于哪种颜色。
此外,在 http://msdn.microsoft.com /en-us/library/zc1dyw8b(v=VS.80).aspx 它表示 Blue
(根据 Microsoft 的说法)是0,0,255
(确实没有异议)。但是Blue
和LightBlue
之间有什么区别呢? 这两页谈论蓝色时不可能表示相同的颜色吗?
有人有QBColor
颜色的RGB转换表吗?我怀疑
QBColor(1)
Blue
等于 RGB(0,0,128)
QBColor(9)
LightBlue
等于 RGB(0,0,255)
I am rewriting a VB6 program in C# and the VB program uses the QBColor
function
At http://msdn.microsoft.com/en-us/library/d2dz8078(v=VS.80).aspx it states which number is equal to which colour.
Furthermore, on http://msdn.microsoft.com/en-us/library/zc1dyw8b(v=VS.80).aspx it says that Blue
(according to Microsoft) is 0,0,255
(no objection really). But what is the then the difference between Blue
and LightBlue
?
Those two pages can not mean the same colour when they talk about blue?
Does anyone have the RGB translation table of the colours for QBColor
? I would suspect that
QBColor(1)
Blue
is equal to RGB(0,0,128)
QBColor(9)
LightBlue
is equal to RGB(0,0,255)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你是对的。蓝色是 (0,0,128)。
下面是从 QBColor 到 RGB 的代码:
Dim Color As Integer
颜色 = 1
Console.WriteLine(&HFF& 和 QBColor(颜色))
Console.WriteLine((&HFF00& 和 QBColor(颜色)) \ 256)
Console.WriteLine((&HFF0000 And QBColor(Color)) \ 65536)
您可以轻松地将其放入循环中以检查所有值。
You're correct. Blue is (0,0,128).
Here is the code to go from QBColor to RGB:
Dim Color As Integer
Color = 1
Console.WriteLine(&HFF& And QBColor(Color))
Console.WriteLine((&HFF00& And QBColor(Color)) \ 256)
Console.WriteLine((&HFF0000 And QBColor(Color)) \ 65536)
You can easily put it in a loop to check all the values.
QBColor
包含在 .Net 框架中,因此您可以在 C# 程序中使用QBColor
。只需参考Microsoft.VisualBasic
。QBColor
is included in the .Net framework, so you could just useQBColor
in your C# program. Just referenceMicrosoft.VisualBasic
.