(CL3000)创建第一个C#应用

1、打开Visual Studio2012或其他版本,新建C#项目:

重新设置项目名,项目路径和解决方案名。

2、环境设置,右击项目名,点击属性:

Build->Platform target:x86

3、拷贝SCL_API.cs到项目文件下:

4、拷贝MiniLED.dll/MiniUtil.dll文件到调试路径下:

5、给窗体添加按钮控件,添加如下代码

namespace DemoCL3000_CSharp01
{
    public partial class Form1 : Form
    {
        MyFun mfun = new MyFun();
        const short mDevId = 10;
        const string IPAddr = "10.1.1.100";
        const short UDPPort = 8081;
        const short TimeOut = 2;
        const short RetryTimes = 1;
        const short LedNum = 0;
        const int Baudrate = 38400;
        const int LedWidth = 320;
        const int LedHeight = 64;
        const short MLeft = 0;
        const short MTop = 0;
        const short XPos = 0;
        const short YPos = 0;
        const short Opt = 130;
        const short Color = 1;
        const string str = "123";

        string s1 = "Line1Hi你好,深圳";
        string s2 = "Line2Hi你好,深圳";
        string s3 = "Line3Hi你好,深圳";
        string s4 = "Line4Hi你好,深圳";
        

        

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MShowString();
            
        }
        public void MShowString() {
            string line1 = mfun.ReadLine(LedWidth, LedHeight, s1, (int)TextAlignment.LEFT);
            string line2 = mfun.ReadLine(LedWidth, LedHeight, s2, (int)TextAlignment.LEFT);
            string line3 = mfun.ReadLine(LedWidth, LedHeight, s3, (int)TextAlignment.LEFT);
            string line4 = mfun.ReadLine(LedWidth, LedHeight, s4, (int)TextAlignment.LEFT);

            SCL_API.MC_NetInitial(mDevId, "", IPAddr, TimeOut, RetryTimes, UDPPort);
            SCL_API.MC_ShowString(mDevId, MLeft, MTop, LedWidth, LedHeight, XPos, YPos, Color, line1 + line2 + line3 + line4, Opt);
            SCL_API.MC_Close(mDevId);
        }
       
    }
}

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值