Esempio n. 1
0
        /// <summary>
        /// 向LED屏指定区域发送单行文本
        /// </summary>
        /// <param name="row1">文字</param>
        /// <param name="XValue">X坐标</param>
        /// <param name="YValue">Y坐标</param>
        /// <param name="Width">长度</param>
        /// <param name="Height">宽度</param>
        /// <param name="FontSize">字号</param>
        /// <param name="InStyle">特技</param>
        /// <returns></returns>
        public bool SendSingleTextByArea(string row1, int XValue, int YValue, int Width, int Height, int FontSize, eInitStyle InStyle, int areano)
        {
            int nResult;

            LedDll.AREARECT AreaRect = new LedDll.AREARECT();            //区域坐标属性结构体变量
            AreaRect.left   = XValue;
            AreaRect.top    = YValue;
            AreaRect.width  = Width;
            AreaRect.height = Height;

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

            LedDll.PLAYPROP PlayProp = new LedDll.PLAYPROP();
            PlayProp.InStyle   = Convert.ToInt32(InStyle);
            PlayProp.DelayTime = 1;
            PlayProp.Speed     = 4;
            //可以添加多个子项到图文区,如下添加可以选一个或多个添加
            nResult = LedDll.LV_QuickAddSingleLineTextArea(HProgram, 1, areano, ref AreaRect, LedDll.ADDTYPE_STRING, row1, ref FontProp, 0);

            if (nResult != 0)            //如果失败则可以调用LV_GetError获取中文错误信息
            {
                ErrStr = LedDll.LS_GetError(nResult);
            }

            return(nResult == 0);
        }
Esempio n. 2
0
        /// <summary>
        /// 发送单行文本
        /// </summary>
        /// <param name="row1"></param>
        /// <returns></returns>
        public bool SendSingleTextAreaUnloadArea(string row1)
        {
            int nResult;

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

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

            nResult = LedDll.LV_QuickAddSingleLineTextArea(HProgram, 1, AreaNo, ref AreaRect, LedDll.ADDTYPE_STRING, row1, ref FontProp, 4); //快速通过字符添加一个单行文本区域,函数见函数声明注示

            if (nResult != 0)                                                                                                                //如果失败则可以调用LV_GetError获取中文错误信息
            {
                ErrStr = LedDll.LS_GetError(nResult);
            }

            return(nResult == 0);
        }
Esempio n. 3
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);
            }
        }