• 大小: 0.28M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-05-03
  • 语言: C#
  • 标签: LED  开发  

资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Demo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        string s1;
        string s2;
        string s3;
        string s4;
        string s5;
        string s6;
        private void button5_Click(object sender EventArgs e)
        {
            int nResult;
            LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
            //ZeroMemory(&CommunicationInfosizeof(COMMUNICATIONINFO));
            //TCP通讯********************************************************************************
            CommunicationInfo.SendType = 0;//设为固定IP通讯模式,即TCP通讯
            CommunicationInfo.IpStr = “192.168.1.99“;//给IpStr赋值LED控制卡的IP
            CommunicationInfo.LedNumber = 1;//LED屏号为1,注意socket通讯和232通讯不识别屏号,默认赋1就行了,485必需根据屏的实际屏号进行赋值
            //广播通讯********************************************************************************
            //CommunicationInfo.SendType=1;//设为单机直连,即广播通讯无需设LED控制器的IP地址
            //串口通讯********************************************************************************
            //CommunicationInfo.SendType=2;//串口通讯
            //CommunicationInfo.Commport=1;//串口的编号,如设备管理器里显示为 COM3 则此处赋值 3
            //CommunicationInfo.Baud=9600;//波特率
            //CommunicationInfo.LedNumber=1;

            int hProgram;//节目句柄
            hProgram = LedDll.LV_CreateProgram(128 128 2);//根据传的参数创建节目句柄,64是屏宽点数,32是屏高点数,2是屏的颜色,注意此处屏宽高及颜色参数必需与设置屏参的屏宽高及颜色一致,否则发送时会提示错误
            //此处可自行判断有未创建成功,hProgram返回NULL失败,非NULL成功一般不会失败

            nResult = LedDll.LV_AddProgram(hProgram 1 0 1);//添加一个节目,参数说明见函数声明注示
            if (nResult != 0)
            {
                string ErrStr;
                ErrStr = LedDll.LS_GetError(nResult);
                MessageBox.Show(ErrStr);
                return;
            }


            //添加一个文本1
            LedDll.AREARECT AreaRect = new LedDll.AREARECT();//区域坐标属性结构体变量
            AreaRect.left = 0;
            AreaRect.top = 32;
            AreaRect.width = 64;
            AreaRect.height = 32;
            LedDll.LV_AddImageTextArea(hProgram 1 1 ref AreaRect 0);
            LedDll.FONTPROP FontProp = new LedDll.FONTPROP();//文字属性
            FontProp.FontName = “宋体“;
            FontProp.FontSize = 12;
            FontProp.FontColor = LedDll.COLOR_GREEN;
            FontProp.FontBold = 0;
            //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
            LedDll.PLAYPROP PlayProp = new LedDll.PLAYPROP();
            PlayProp.Instyle = 0;
            PlayProp.DelayTime = 3;
            PlayProp.Speed = 4;
            nResult = LedDll.LV_AddMultiLine

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      19456  2020-12-28 15:42  LED\Demo\bin\Debug\Demo.exe

     文件      38400  2020-12-28 15:42  LED\Demo\bin\Debug\Demo.pdb

     文件      22712  2020-12-28 15:42  LED\Demo\bin\Debug\Demo.vshost.exe

     文件        490  2010-03-17 22:39  LED\Demo\bin\Debug\Demo.vshost.exe.manifest

     文件     566784  2017-04-12 16:45  LED\Demo\bin\Debug\lv_led.dll

     文件      22811  2020-12-28 15:42  LED\Demo\Form1.cs

     文件       6005  2020-12-28 15:42  LED\Demo\Form1.Designer.cs

     文件       6008  2020-12-28 15:42  LED\Demo\Form1.resx

     文件       4747  2020-12-28 09:27  LED\Demo\LED.csproj

     文件      47358  2016-01-12 09:19  LED\Demo\LedDll.cs

     文件        814  2016-07-06 14:20  LED\Demo\obj\Debug\Demo.csproj.FileListAbsolute.txt

     文件        847  2015-12-23 16:09  LED\Demo\obj\Debug\Demo.csproj.GenerateResource.Cache

     文件      19456  2016-07-06 14:20  LED\Demo\obj\Debug\Demo.exe

     文件        180  2015-12-23 16:09  LED\Demo\obj\Debug\Demo.Form1.resources

     文件      38400  2016-07-06 14:20  LED\Demo\obj\Debug\Demo.pdb

     文件        180  2015-12-23 13:09  LED\Demo\obj\Debug\Demo.Properties.Resources.resources

     文件       2359  2020-12-28 14:57  LED\Demo\obj\x86\Debug\Demo.csproj.FileListAbsolute.txt

     文件        847  2020-12-28 14:34  LED\Demo\obj\x86\Debug\Demo.csproj.GenerateResource.Cache

     文件       1467  2020-12-28 14:34  LED\Demo\obj\x86\Debug\Demo.csprojResolveAssemblyReference.cache

     文件      19456  2020-12-28 15:42  LED\Demo\obj\x86\Debug\Demo.exe

     文件        180  2020-12-28 15:42  LED\Demo\obj\x86\Debug\Demo.Form1.resources

     文件      38400  2020-12-28 15:42  LED\Demo\obj\x86\Debug\Demo.pdb

     文件        180  2020-12-28 14:06  LED\Demo\obj\x86\Debug\Demo.Properties.Resources.resources

     文件       1231  2020-12-28 15:27  LED\Demo\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6551  2020-12-28 15:02  LED\Demo\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        520  2020-12-28 15:42  LED\Demo\obj\x86\Debug\LED.csproj.FileListAbsolute.txt

     文件        847  2020-12-28 15:42  LED\Demo\obj\x86\Debug\LED.csproj.GenerateResource.Cache

     文件       1467  2020-12-28 15:33  LED\Demo\obj\x86\Debug\LED.csprojResolveAssemblyReference.cache

     文件       4608  2020-12-28 09:27  LED\Demo\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件        465  2015-12-23 09:53  LED\Demo\Program.cs

............此处省略24个文件信息

评论

共有 条评论