在好例子网,分享、交流、成长!
您当前所在位置:首页C# 开发实例C#多媒体编程 → 灵信LED开发

灵信LED开发

C#多媒体编程

下载此实例
  • 开发语言:C#
  • 实例大小:0.28M
  • 下载次数:26
  • 浏览次数:535
  • 发布时间:2020-12-29
  • 实例类别:C#多媒体编程
  • 发 布 人:724885283
  • 文件格式:.rar
  • 所需积分:2
 相关标签: LED 开发

实例介绍

【实例简介】

【实例截图】

from clipboard

【核心代码】

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
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(&CommunicationInfo,sizeof(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_AddMultiLineTextToImageTextArea(hProgram, 1, 1, LedDll.ADDTYPE_STRING, textBox1.Text   "g", ref FontProp, ref PlayProp, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
            //添加一个文本2
            LedDll.AREARECT AreaRect1 = new LedDll.AREARECT();//区域坐标属性结构体变量
            AreaRect1.left = 0;
            AreaRect1.top = 64;
            AreaRect1.width = 64;
            AreaRect1.height = 32;
            LedDll.LV_AddImageTextArea(hProgram, 1, 2, ref AreaRect1, 0);
            LedDll.FONTPROP FontProp1 = new LedDll.FONTPROP();//文字属性
            FontProp1.FontName = "宋体";
            FontProp1.FontSize = 12;
            FontProp1.FontColor = LedDll.COLOR_GREEN;
            FontProp1.FontBold = 0;
            //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
            LedDll.PLAYPROP PlayProp1 = new LedDll.PLAYPROP();
            PlayProp1.InStyle = 0;
            PlayProp1.DelayTime = 3;
            PlayProp1.Speed = 4;
            nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING,textBox2.Text  "g", ref FontProp1, ref PlayProp1, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
            //添加一个文本3
            LedDll.AREARECT AreaRect2 = new LedDll.AREARECT();//区域坐标属性结构体变量
            AreaRect2.left = 0;
            AreaRect2.top = 96;
            AreaRect2.width = 64;
            AreaRect2.height = 32;
            LedDll.LV_AddImageTextArea(hProgram, 1, 3, ref AreaRect2, 0);
            LedDll.FONTPROP FontProp2 = new LedDll.FONTPROP();//文字属性
            FontProp2.FontName = "宋体";
            FontProp2.FontSize = 12;
            FontProp2.FontColor = LedDll.COLOR_GREEN;
            FontProp2.FontBold = 0;
            //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
            LedDll.PLAYPROP PlayProp2 = new LedDll.PLAYPROP();
            PlayProp2.InStyle = 0;
            PlayProp2.DelayTime = 3;
            PlayProp2.Speed = 4;
            nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 3, LedDll.ADDTYPE_STRING, textBox3.Text   "g", ref FontProp2, ref PlayProp2, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
           
            //添加一个文本4
            LedDll.AREARECT AreaRect3 = new LedDll.AREARECT();//区域坐标属性结构体变量
            AreaRect3.left = 64;
            AreaRect3.top = 32;
            AreaRect3.width = 64;
            AreaRect3.height = 32;
            LedDll.LV_AddImageTextArea(hProgram, 1, 4, ref AreaRect3, 0);
            LedDll.FONTPROP FontProp3 = new LedDll.FONTPROP();//文字属性
            FontProp3.FontName = "宋体";
            FontProp3.FontSize = 12;
            FontProp3.FontColor = LedDll.COLOR_GREEN;
            FontProp3.FontBold = 0;
            //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
            LedDll.PLAYPROP PlayProp3 = new LedDll.PLAYPROP();
            PlayProp3.InStyle = 0;
            PlayProp3.DelayTime = 3;
            PlayProp3.Speed = 4;
            nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 4, LedDll.ADDTYPE_STRING, textBox4.Text   "g", ref FontProp3, ref PlayProp3, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
           
            //添加一个文本5
            LedDll.AREARECT AreaRect4 = new LedDll.AREARECT();//区域坐标属性结构体变量
            AreaRect4.left = 64;
            AreaRect4.top = 64;
            AreaRect4.width = 64;
            AreaRect4.height = 32;
            LedDll.LV_AddImageTextArea(hProgram, 1, 5, ref AreaRect4, 0);
            LedDll.FONTPROP FontProp4 = new LedDll.FONTPROP();//文字属性
            FontProp4.FontName = "宋体";
            FontProp4.FontSize = 12;
            FontProp4.FontColor = LedDll.COLOR_GREEN;
            FontProp4.FontBold = 0;
            //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
            LedDll.PLAYPROP PlayProp4 = new LedDll.PLAYPROP();
            PlayProp4.InStyle = 0;
            PlayProp4.DelayTime = 3;
            PlayProp4.Speed = 4;
            nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 5, LedDll.ADDTYPE_STRING, textBox5.Text   "g", ref FontProp4, ref PlayProp4, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
            
            //添加一个文本6
            LedDll.AREARECT AreaRect5 = new LedDll.AREARECT();//区域坐标属性结构体变量
            AreaRect5.left = 64;
            AreaRect5.top = 96;
            AreaRect5.width = 64;
            AreaRect5.height = 32;
            LedDll.LV_AddImageTextArea(hProgram, 1, 6, ref AreaRect5, 0);
            LedDll.FONTPROP FontProp5 = new LedDll.FONTPROP();//文字属性
            FontProp5.FontName = "宋体";
            FontProp5.FontSize = 12;
            FontProp5.FontColor = LedDll.COLOR_GREEN;
            FontProp5.FontBold = 0;
            //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
            LedDll.PLAYPROP PlayProp5 = new LedDll.PLAYPROP();
            PlayProp5.InStyle = 0;
            PlayProp5.DelayTime = 3;
            PlayProp5.Speed = 4;
            nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 6, LedDll.ADDTYPE_STRING, textBox6.Text   "g", ref FontProp5, ref PlayProp5, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
            //添加一个文本7
            LedDll.AREARECT AreaRect6 = new LedDll.AREARECT();//区域坐标属性结构体变量
            AreaRect6.left = 0;
            AreaRect6.top = 0;
            AreaRect6.width = 128;
            AreaRect6.height = 32;
            LedDll.LV_AddImageTextArea(hProgram, 1, 7, ref AreaRect6, 0);
            LedDll.FONTPROP FontProp6 = new LedDll.FONTPROP();//文字属性
            FontProp6.FontName = "宋体";
            FontProp6.FontSize = 12;
            FontProp6.FontColor = LedDll.COLOR_GREEN;
            FontProp6.FontBold = 0;
            //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
            LedDll.PLAYPROP PlayProp6 = new LedDll.PLAYPROP();
            PlayProp6.InStyle = 0;
            PlayProp6.DelayTime = 3;
            PlayProp6.Speed = 4;
            nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 7, LedDll.ADDTYPE_STRING,  "重量显示", ref FontProp6, ref PlayProp6, 2, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
 
            nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
            LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
            if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
            {
                string ErrStr;
                ErrStr = LedDll.LS_GetError(nResult);
                MessageBox.Show(ErrStr);
            }
            else
            {
                MessageBox.Show("发送成功");
            }
        }
 
       
 
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Enabled = false;
            if (s1 != textBox1.Text || s2 != textBox2.Text || s3 != textBox3.Text || s4 != textBox4.Text || s5 != textBox5.Text || s6 != textBox6.Text)
            {
                s1 = textBox1.Text;
                s2 = textBox2.Text;
                s3 = textBox3.Text;
                s4 = textBox4.Text;
                s5 = textBox5.Text;
                s6 = textBox6.Text;
                int nResult;
                LedDll.COMMUNICATIONINFO CommunicationInfo = new LedDll.COMMUNICATIONINFO();//定义一通讯参数结构体变量用于对设定的LED通讯,具体对此结构体元素赋值说明见COMMUNICATIONINFO结构体定义部份注示
                //ZeroMemory(&CommunicationInfo,sizeof(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_AddMultiLineTextToImageTextArea(hProgram, 1, 1, LedDll.ADDTYPE_STRING, textBox1.Text   "g", ref FontProp, ref PlayProp, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
                //添加一个文本2
                LedDll.AREARECT AreaRect1 = new LedDll.AREARECT();//区域坐标属性结构体变量
                AreaRect1.left = 0;
                AreaRect1.top = 64;
                AreaRect1.width = 64;
                AreaRect1.height = 32;
                LedDll.LV_AddImageTextArea(hProgram, 1, 2, ref AreaRect1, 0);
                LedDll.FONTPROP FontProp1 = new LedDll.FONTPROP();//文字属性
                FontProp1.FontName = "宋体";
                FontProp1.FontSize = 12;
                FontProp1.FontColor = LedDll.COLOR_GREEN;
                FontProp1.FontBold = 0;
                //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
                LedDll.PLAYPROP PlayProp1 = new LedDll.PLAYPROP();
                PlayProp1.InStyle = 0;
                PlayProp1.DelayTime = 3;
                PlayProp1.Speed = 4;
                nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 2, LedDll.ADDTYPE_STRING, textBox2.Text   "g", ref FontProp1, ref PlayProp1, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
                //添加一个文本3
                LedDll.AREARECT AreaRect2 = new LedDll.AREARECT();//区域坐标属性结构体变量
                AreaRect2.left = 0;
                AreaRect2.top = 96;
                AreaRect2.width = 64;
                AreaRect2.height = 32;
                LedDll.LV_AddImageTextArea(hProgram, 1, 3, ref AreaRect2, 0);
                LedDll.FONTPROP FontProp2 = new LedDll.FONTPROP();//文字属性
                FontProp2.FontName = "宋体";
                FontProp2.FontSize = 12;
                FontProp2.FontColor = LedDll.COLOR_GREEN;
                FontProp2.FontBold = 0;
                //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
                LedDll.PLAYPROP PlayProp2 = new LedDll.PLAYPROP();
                PlayProp2.InStyle = 0;
                PlayProp2.DelayTime = 3;
                PlayProp2.Speed = 4;
                nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 3, LedDll.ADDTYPE_STRING, textBox3.Text   "g", ref FontProp2, ref PlayProp2, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
                //添加一个文本4
                LedDll.AREARECT AreaRect3 = new LedDll.AREARECT();//区域坐标属性结构体变量
                AreaRect3.left = 64;
                AreaRect3.top = 32;
                AreaRect3.width = 64;
                AreaRect3.height = 32;
                LedDll.LV_AddImageTextArea(hProgram, 1, 4, ref AreaRect3, 0);
                LedDll.FONTPROP FontProp3 = new LedDll.FONTPROP();//文字属性
                FontProp3.FontName = "宋体";
                FontProp3.FontSize = 12;
                FontProp3.FontColor = LedDll.COLOR_GREEN;
                FontProp3.FontBold = 0;
                //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
                LedDll.PLAYPROP PlayProp3 = new LedDll.PLAYPROP();
                PlayProp3.InStyle = 0;
                PlayProp3.DelayTime = 3;
                PlayProp3.Speed = 4;
                nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 4, LedDll.ADDTYPE_STRING, textBox4.Text   "g", ref FontProp3, ref PlayProp3, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
                //添加一个文本5
                LedDll.AREARECT AreaRect4 = new LedDll.AREARECT();//区域坐标属性结构体变量
                AreaRect4.left = 64;
                AreaRect4.top = 64;
                AreaRect4.width = 64;
                AreaRect4.height = 32;
                LedDll.LV_AddImageTextArea(hProgram, 1, 5, ref AreaRect4, 0);
                LedDll.FONTPROP FontProp4 = new LedDll.FONTPROP();//文字属性
                FontProp4.FontName = "宋体";
                FontProp4.FontSize = 12;
                FontProp4.FontColor = LedDll.COLOR_GREEN;
                FontProp4.FontBold = 0;
                //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
                LedDll.PLAYPROP PlayProp4 = new LedDll.PLAYPROP();
                PlayProp4.InStyle = 0;
                PlayProp4.DelayTime = 3;
                PlayProp4.Speed = 4;
                nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 5, LedDll.ADDTYPE_STRING, textBox5.Text   "g", ref FontProp4, ref PlayProp4, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
                //添加一个文本6
                LedDll.AREARECT AreaRect5 = new LedDll.AREARECT();//区域坐标属性结构体变量
                AreaRect5.left = 64;
                AreaRect5.top = 96;
                AreaRect5.width = 64;
                AreaRect5.height = 32;
                LedDll.LV_AddImageTextArea(hProgram, 1, 6, ref AreaRect5, 0);
                LedDll.FONTPROP FontProp5 = new LedDll.FONTPROP();//文字属性
                FontProp5.FontName = "宋体";
                FontProp5.FontSize = 12;
                FontProp5.FontColor = LedDll.COLOR_GREEN;
                FontProp5.FontBold = 0;
                //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
                LedDll.PLAYPROP PlayProp5 = new LedDll.PLAYPROP();
                PlayProp5.InStyle = 0;
                PlayProp5.DelayTime = 3;
                PlayProp5.Speed = 4;
                nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 6, LedDll.ADDTYPE_STRING, textBox6.Text   "g", ref FontProp5, ref PlayProp5, 1, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
                //添加一个文本7
                LedDll.AREARECT AreaRect6 = new LedDll.AREARECT();//区域坐标属性结构体变量
                AreaRect6.left = 0;
                AreaRect6.top = 0;
                AreaRect6.width = 128;
                AreaRect6.height = 32;
                LedDll.LV_AddImageTextArea(hProgram, 1, 7, ref AreaRect6, 0);
                LedDll.FONTPROP FontProp6 = new LedDll.FONTPROP();//文字属性
                FontProp6.FontName = "宋体";
                FontProp6.FontSize = 12;
                FontProp6.FontColor = LedDll.COLOR_GREEN;
                FontProp6.FontBold = 0;
                //int nsize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(LedDll.FONTPROP));
                LedDll.PLAYPROP PlayProp6 = new LedDll.PLAYPROP();
                PlayProp6.InStyle = 0;
                PlayProp6.DelayTime = 3;
                PlayProp6.Speed = 4;
                nResult = LedDll.LV_AddMultiLineTextToImageTextArea(hProgram, 1, 7, LedDll.ADDTYPE_STRING, "重量显示", ref FontProp6, ref PlayProp6, 2, 1);//通过字符串添加一个多行文本到图文区,参数说明见声明注示
 
               
                nResult = LedDll.LV_Send(ref CommunicationInfo, hProgram);//发送,见函数声明注示
                LedDll.LV_DeleteProgram(hProgram);//删除节目内存对象,详见函数声明注示
                if (nResult != 0)//如果失败则可以调用LV_GetError获取中文错误信息
                {
                    string ErrStr;
                    ErrStr = LedDll.LS_GetError(nResult);
                    MessageBox.Show(ErrStr);
                }
            }
            
           timer1.Enabled = true;
        }
 
       
 
  
    }
}

标签: LED 开发

实例下载地址

灵信LED开发

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警