private void FrmMain_Load(object sender, EventArgs e) { this.handle = (UInt32)this.Handle; fontName = ConfigurationManager.AppSettings["FontName"]; fontColor = Convert.ToInt32(ConfigurationManager.AppSettings["FontColor"], 16); fontSize = Convert.ToInt32(ConfigurationManager.AppSettings["FontSize"]); fontStyle = Convert.ToInt32(ConfigurationManager.AppSettings["FontStyle"]); var position = ConfigurationManager.AppSettings["Position"].Split(','); rectText = new Rectangle( Convert.ToInt32(position[0]), Convert.ToInt32(position[1]), Convert.ToInt32(position[2]), Convert.ToInt32(position[3])); this.client.ServerIP = ip; this.client.ServerPort = ushort.Parse(port); this.client.ClientType = ClientType.LEDDisplay; this.client.ClientName = clientName; this.client.Start(); this.client.OnResult += (msgType, msgText) => { this.messageIndicator1.SetState(StateType.Success, msgText); }; this.client.OnDisconnect += () => { this.messageIndicator1.SetState(StateType.Error, "未连接"); }; this.client.OnMessage += new Action <QueueMessage.Message>(client_OnMessage); LEDSender = new CLEDSender(); LEDSender.Do_LED_Startup(); this.listLedControl = this.ledControlBll.GetModelList(); this.listLedWin = this.ledWinBll.GetModelList(); this.Close(); this.notifyIcon1.ShowBalloonTip(3000); }
private void PowerON_Load(object sender, EventArgs e) { LEDSender2.Do_LED_Startup(); TSenderParam param = new TSenderParam(); GetDeviceParam(ref param.devParam); param.notifyMode = LEDSender2.NOTIFY_EVENT; param.wmHandle = (UInt32)Handle; LEDSender2.Do_LED_SetPower(ref param, 1); i = 1; }
private void sendText(string context, int row) { LEDSender.Do_LED_Startup(); TSenderParam param = new TSenderParam(); ushort K; GetDeviceParam(ref param.devParam); param.notifyMode = LEDSender.NOTIFY_BLOCK; param.wmHandle = (UInt32)0; param.wmMessage = WM_LED_NOTIFY; System.Drawing.Font font = new System.Drawing.Font("宋体", float.Parse(zt)); K = (ushort)LEDSender.Do_MakeRoot(LEDSender.ROOT_PLAY, LEDSender.COLOR_MODE_DOUBLE, LEDSender.SURVIVE_ALWAYS); LEDSender.Do_AddChapter(K, 3000, LEDSender.WAIT_CHILD); LEDSender.Do_AddRegion(K, int.Parse(left), int.Parse(top) + font.Height * row + 3, int.Parse(width), int.Parse(height), 0);//-18 //第1页面 LEDSender.Do_AddLeaf(K, 3000, LEDSender.WAIT_CHILD); //自动换行的文字 // LEDSender.Do_AddText(K, 0, 0, 64, 16, LEDSender.V_TRUE, 0, "Hello world! 宁采成,HELLO WORLD!", "宋体", 9, 0xff, LEDSender.WFS_NONE, LEDSender.V_TRUE, 0, 0, 1, 1, 1, 0, 1, 3); //非自动换行的文字 if (row >= 0) { LEDSender.Do_AddText(K, 0, 16, 64, 64, LEDSender.V_TRUE, 0, context, "宋体", int.Parse(zt), 0xff00, LEDSender.WFS_NONE, LEDSender.V_TRUE, 0, 2, 3, 1, 1, 0, 0, 1);//0 静态显示 } //if (row >=1) // LEDSender.Do_AddText(K, 0, 16+font.Height*row+3, 64, 32, LEDSender.V_TRUE, 0, context, "宋体", int.Parse(zt), 0xff00, LEDSender.WFS_NONE, LEDSender.V_TRUE, 0, 2, 3, 1, 1, 1, 0, 1); //System.Threading.Thread.Sleep(100000); // LEDSender.Do_AddText(K, 0, 16, 64, 32, LEDSender.V_TRUE, 0, "谢谢,收您1000.找您50", "宋体", 12, 0xff00, LEDSender.WFS_NONE, LEDSender.V_TRUE,0, 2, 3, 1, 1, 1, 1, 1); //第2页面 // LEDSender.Do_AddLeaf(K, 10000, LEDSender.WAIT_CHILD); //非自动换行的文字 // LEDSender.Do_AddText(K, 0, 0, 64, 16, LEDSender.V_TRUE, 0, "Hello world!", "宋体", 12, 0xffff, LEDSender.WFS_NONE, LEDSender.V_TRUE, 0, 0, 1, 1, 1, 1, 1, 5); Parse2(LEDSender.Do_LED_SendToScreen(ref param, K)); }
private void frmMain_Load(object sender, EventArgs e) { LEDSender.Do_LED_Startup(); //LEDSender.Do_LED_CloseDeviceOnTerminate(1); }