Exemplo n.º 1
0
        /// <summary>
        /// 发送节目内容
        /// </summary>
        /// <param name="isdelprogram">是否删除节目</param>
        /// <returns></returns>
        public bool Send(bool isdelprogram = false)
        {
            int nResult;

            nResult = LedDll.LV_Send(ref CommunicationInfo, HProgram);            //发送,见函数声明注示
            if (isdelprogram)
            {
                LedDll.LV_DeleteProgram(HProgram);                //删除节目内存对象,详见函数声明注示
                this.HProgram = 0;
            }
            if (nResult != 0)            //如果失败则可以调用LV_GetError获取中文错误信息
            {
                ErrStr = LedDll.LS_GetError(nResult);
            }
            return(nResult == 0);
        }
Exemplo n.º 2
0
        public void test()
        {
            int nResult;

            LedDll.AREARECT AreaRect = new LedDll.AREARECT();            //区域坐标属性结构体变量
            AreaRect.left   = 0;
            AreaRect.top    = 0;
            AreaRect.width  = 64;
            AreaRect.height = 16;

            LedDll.FONTPROP FontProp = new LedDll.FONTPROP();            //文字属性
            FontProp.FontName  = "宋体";
            FontProp.FontSize  = 12;
            FontProp.FontColor = LedDll.COLOR_RED;
            FontProp.FontBold  = 0;

            nResult = LedDll.LV_QuickAddSingleLineTextArea(hProgram, 1, 1, ref AreaRect, LedDll.ADDTYPE_STRING, "上海灵信视觉技术股份有限公司", ref FontProp, 4);            //快速通过字符添加一个单行文本区域,函数见函数声明注示

            AreaRect.left   = 64;
            AreaRect.top    = 16;
            AreaRect.width  = 64;
            AreaRect.height = 16;
            LedDll.DIGITALCLOCKAREAINFO DigitalClockAreaInfo = new LedDll.DIGITALCLOCKAREAINFO();
            DigitalClockAreaInfo.TimeColor = LedDll.COLOR_RED;

            DigitalClockAreaInfo.ShowStrFont.FontName = "宋体";
            DigitalClockAreaInfo.ShowStrFont.FontSize = 12;
            DigitalClockAreaInfo.IsShowHour           = 1;
            DigitalClockAreaInfo.IsShowMinute         = 1;


            nResult = LedDll.LV_AddDigitalClockArea(hProgram, 1, 2, ref AreaRect, ref DigitalClockAreaInfo); //注意区域号不能一样,详见函数声明注示

            nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);                                       //发送,见函数声明注示
            LedDll.LV_DeleteProgram(hProgram);                                                               //删除节目内存对象,详见函数声明注示
            if (nResult != 0)                                                                                //如果失败则可以调用LV_GetError获取中文错误信息
            {
                string ErrStr;
                ErrStr = LedDll.LS_GetError(nResult);
            }
        }