PHP中的OLE_COLOR转换

时间:2012-07-26 03:28:37

标签: php vb.net

我正在用PHP编写脚本,需要调用一个以OLE_COLOR作为参数的方法。我已经尝试了我能想到的所有内容以及其他人到目前为止的建议,我能得到的最好的是类型不匹配错误。这些是API提供商提供的各种语言的数据类型说明:

  

C ++:static_cast(RGB(0,0,255))

     

VB6:RGB(0,0,255)

     

VB.NET:   Convert.ToUInt32(System.Drawing.ColorTranslator.ToOle(Color.FromArgb(0,   0,255))

     

C#:( uint)System.Drawing.ColorTranslator.ToOle(Color.FromArgb(0,0,   255))

     

其他:以下格式的32位整数值:0x00bbggrr(在BGR中   格式,而不是RGB)

方法原型是:

Sub AddHyperlink(InputFileName As String,
                 OutputFileName As String,
                 From As Long,
                 To As Long,
                 Left As Double,
                 Top As Double,
                 Right As Double,
                 Bottom As Double,
                 Url As String,
                 Style As prcAnnotBorderStyle,
                 Color As OLE_COLOR)

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

Windows中的

OLE_COLOR是一个整数,格式为0x00bbggrr。这意味着color = red + 256 * green + 65536 * blue,其中每个组件的范围为0-255。 0x000000ff为纯红色,0x0000ff00为纯绿色,0x00ff0000为纯蓝色。