int __stdcall SetLogoDisplayMode(HANDLE hChannelHandle,  
COLORREF ColorKey, BOOL Translucent, int TwinkleInterval) 
以上是VC的以下是C#的
        public static extern int SetLogoDisplayMode(
            IntPtr hChannelHandle,
            ???ColorKey,//如何写?
            bool Translucent,
            int TwinkleInterval);另外 我在C#代码中如何调用SetLogoDisplayMode函数 最主要的是 ColorKey写什么值 达人们帮忙看看。谢谢

解决方案 »

  1.   

    你可以写一个方法来把一个RGB转换为COLORREF,比如:public static int RGBToCOLORREF(int rgbValue)
    {
        int num = (rgbValue & 0xff) << 0x10;
        rgbValue &= 0xffff00;
        rgbValue |= (rgbValue >> 0x10) & 0xff;
        rgbValue &= 0xffff;
        rgbValue |= num;
        return rgbValue;
    }  
      

  2.   

    ColorKey参数类型 是int类型?
      

  3.   

    应该这样合适些:public static int ColorToCOLORREF(Color color)
    {
        return ((color.R | (color.G << 8)) | (color.B << 0x10));
    }  
    你把那个参数声明成整数试试看
      

  4.   

    int __stdcall LoadYUVFromBmpFile(char *FileName, unsigned char *yuv,  
    int BufLen, int *Width, int *Height) 
    char *FileName              文件名
    unsigned char *yuvYUV422    图像指针
    int BufLenYUV422            图像缓存大小
    int *Width YUV422           返回的图像高度
    int *Height YUV422          返回的图像宽度我在C#是这样定义的
            public static extern int LoadYUVFromBmpFile(
                byte[] fileName,
                byte[] yuv,
                int BufLen,
                int Width,
                int Height);
    在C#中调用(bmp是24位的32*32图像)
                byte[] yuv = new byte[32 * 32 *2];
                string strFileName = @"D:\JTJQ.bmp";
                DS4000HCSDK.LoadYUVFromBmpFile(System.Text.Encoding.ASCII.GetBytes(strFileName), yuv, 1024, 32, 32); 按SDK说明正确应该返回0  可是我一直返回负数。。
    请帮我看看 
    我追加分数 或者另外开帖子  
    谢谢