public void getFBProfileImage(PictureCallBack pcb) { this.pcb = pcb; if (fbTexture != null) { this.pcb(fbTexture); } else { FB.API("me/picture?width=100&height=100", HttpMethod.GET, FBPictureCallBack); } }
private void DrawLocation(List <CRLStationInfo> stationinfo, string moinfo) { if (pic.InvokeRequired) { PictureCallBack dlgtRichtxb = new PictureCallBack(DrawLocation); this.Invoke(dlgtRichtxb, new object[] { stationinfo, moinfo }); } else { Graphics g = pic.CreateGraphics(); SolidBrush brush; Pen pen; g.DrawLine(pen = new Pen(brush = new SolidBrush(Color.Silver), 2), 0, 0, pic.Width, 0); for (int i = cell; i < pic.Width; i += cell) { g.DrawLine(pen = new Pen(brush = new SolidBrush(Color.Silver), 1), 0, i, pic.Width, i); } for (int j = 0; j < pic.Width; j += cell) { g.DrawLine(pen = new Pen(brush = new SolidBrush(Color.Silver), 1), j, 0, j, pic.Height); } foreach (CRLStationInfo si in stationinfo) { if (si.stationno == si.tostation && si.stationtype != 0 && si.taskno > 0) { g.FillRectangle(brush = new SolidBrush(Color.Chocolate), si.LocationX * cell, si.LocationY * cell, (cell - 1) * si.Width, (cell - 1) * si.Height); } else { g.FillRectangle(brush = new SolidBrush(si.taskno == 0 ? Color.Gray : Color.Lime), si.LocationX * cell, si.LocationY * cell, (cell - 1) * si.Width, (cell - 1) * si.Height); } g.DrawString(si.stationno.ToString(), new Font("宋体", size, FontStyle.Regular), brush = new SolidBrush(Color.Black), si.LocationX * cell, si.LocationY * cell + cell / 3); } brush.Dispose(); pen.Dispose(); g.Dispose(); GC.Collect(); } }
public void getGoogleProfileImage(PictureCallBack pcb) { Debug.Log("Goole picture request"); this.pcb = pcb; if (googleTexture != null) { this.pcb(googleTexture); } else { //Participant p = PlayGamesPlatform.Instance.RealTime.GetSelf(); //Debug.Log(p.Player.AvatarURL); //Debug.Log(Social.localUser.image); //Debug.Log(((PlayGamesLocalUser)Social.localUser).mPlatform.image); //Debug.Log(((PlayGamesLocalUser)Social.localUser).image); //StartCoroutine(LoadImage(Social.localUser.image)); } }
private void DrawConnect(List <CRCObject> cob, List <CRCStatus> css) { if (pic.InvokeRequired) { PictureCallBack pc = new PictureCallBack(DrawConnect); this.Invoke(pc, new object[] { cob, css }); } else { bool refresh = false; Graphics g = pic.CreateGraphics(); SolidBrush brush; Pen pen; foreach (CRCObject cco in cob) { CRCStatus ccs = css.Find( delegate(CRCStatus crcs) { return(crcs.CRCNum == cco.ScNo && cco.Port == 4000); } ); if (ccs != null) { if (ccs.Change) { refresh = true; } } } if (refresh) { pic.Refresh(); } g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 1), 2, 2, 40, 24); g.FillRectangle(brush = new SolidBrush(Color.SkyBlue), 4, 4, 37, 21); g.DrawString(taskmode, new Font("宋体", 12, FontStyle.Bold), brush = new SolidBrush(taskmode == "自动" ? Color.Blue : Color.Red), 4, 6); foreach (CRCObject co in cob) { CRCStatus findcs = css.Find( delegate(CRCStatus info) { return(info.CRCNum == co.ScNo && co.Port == 4000); } ); if (findcs != null) { int num = int.Parse(findcs.CRCNum.Substring(3, 3)) - 1; int cell = 170; //卫星小车载体 g.FillRectangle(brush = new SolidBrush(co.connectstatus == 1 ? Color.Green : Color.Gray), 20 + num * cell, 311, 120, 14); //卫星小车滚轮 g.DrawEllipse(pen = new Pen(brush = new SolidBrush(Color.Black), 1), 25 + num * cell, 317, 9, 9); g.FillEllipse(brush = new SolidBrush(Color.Black), 25 + num * cell, 317, 9, 9); g.DrawEllipse(pen = new Pen(brush = new SolidBrush(Color.Black), 1), 125 + num * cell, 317, 9, 9); g.FillEllipse(brush = new SolidBrush(Color.Black), 125 + num * cell, 317, 9, 9); //卫星小车主臂1 g.FillRectangle(brush = new SolidBrush(co.connectstatus == 1 ? Color.Green : Color.Gray), 70 + num * cell, 15, 16, 304); //卫星小车电柜2 g.FillRectangle(brush = new SolidBrush(Color.SlateGray), 100 + num * cell, 251, 22, 60); g.DrawString(findcs.CRCNum.Substring(3, 3), new Font("宋体", 10, FontStyle.Bold), brush = new SolidBrush(Color.Blue), 60 + num * cell, 309); //卫星小车爬梯3456 for (int i = 15; i < 303; i = i + 11) { g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.SlateGray), 1), 87 + num * cell, i, 10, 10); } //爬梯与电柜的连接体7 g.DrawLine(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 85 + num * cell, 251, 100 + num * cell, 251); //卫星小车货叉 g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 22 + num * cell, 300, 114, 3);//(200 - 25 * int.Parse(findcs.RackLevel)) + 150 g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 133 + num * cell, 290, 3, 10); g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 22 + num * cell, 290, 3, 10); // g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 60 + num * cell, (200 - 25 * int.Parse(findcs.RackLevel)) + 100, 20, 4); //货物及任务号 if (findcs.TaskNo != "0") { if (int.Parse(findcs.FunctionReport) > 120) { g.FillRectangle(brush = new SolidBrush(Color.Chocolate), 29 + num * cell, (200 - 25 * int.Parse(findcs.RackLevel)) + 65, 100, 60); } g.DrawString(findcs.TaskNo.ToString(), new Font("宋体", 10, FontStyle.Bold), brush = new SolidBrush(Color.Blue), 62 + num * cell, (200 - 25 * int.Parse(findcs.RackLevel)) + 110); } else { g.FillRectangle(brush = new SolidBrush(Color.Silver), 25 + num * cell, (200 - 25 * int.Parse(findcs.RackLevel)) + 85, 30, 22); } //状态信息及报警信息 if (findcs.LabelInfo != null) { string[] info = findcs.LabelInfo.Split(new char[] { '.' }); for (int i = 0; i < 5; i++) { //g.DrawString(info[i], new Font("宋体", 10, FontStyle.Regular), brush = new SolidBrush(Color.Blue), 20 + num * cell, 333 + 20 * i); if (i != 2) { g.DrawString(info[i], new Font("宋体", 9, FontStyle.Regular), brush = new SolidBrush(Color.Blue), 20 + num * cell, 333 + 20 * i); } else { if (info[2] != "模式:自动;就绪;正常;远程;") { g.DrawString(info[i], new Font("宋体", 9, FontStyle.Regular), brush = new SolidBrush(Color.OrangeRed), 20 + num * cell, 333 + 20 * i); } else { g.DrawString(info[i], new Font("宋体", 9, FontStyle.Regular), brush = new SolidBrush(Color.Blue), 20 + num * cell, 333 + 20 * i); } } } if (info.Length > 5) { for (int j = 0; j < info.Length - 5; j++) { g.DrawString(info[5 + j], new Font("宋体", 9, FontStyle.Bold), brush = new SolidBrush(Color.Red), 20 + num * cell, 433 + 15 * j); } //for (int j = 0; j < info[info.Length - 1].Length / 15; j++) //{ // g.DrawString(info[info.Length - 1].Substring(j * 15, 15), new Font("宋体", 10, FontStyle.Bold), brush = new SolidBrush(Color.Red), 20 + num * cell, 333 + 20 * (info.Length - 1) + 15 * j); //} } } } } brush.Dispose(); pen.Dispose(); g.Dispose(); GC.Collect(); } }
private void DrawConnect(List <CRNObject> cob, List <CRNStatus> css) { try { if (pic.InvokeRequired) { PictureCallBack pc = new PictureCallBack(DrawConnect); this.Invoke(pc, new object[] { cob, css }); } else { bool refresh = false; Graphics g = pic.CreateGraphics(); SolidBrush brush; Pen pen; foreach (CRNObject cco in cob) { CRNStatus ccs = css.Find( delegate(CRNStatus crcs) { return(crcs.CRCNum == cco.ScNo && crcs.Zone == _zone); } ); if (ccs != null) { if (ccs.Change) { refresh = true; } } } if (refresh) { pic.Refresh(); } g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 1), 2, 2, 40, 24); g.FillRectangle(brush = new SolidBrush(Color.SkyBlue), 4, 4, 37, 21); g.DrawString(taskmode, new Font("宋体", 12, FontStyle.Bold), brush = new SolidBrush(taskmode == "自动" ? Color.Blue : Color.Red), 4, 6); foreach (CRNObject co in cob) { CRNStatus findcs = css.Find( delegate(CRNStatus info) { return(info.CRCNum == co.ScNo && info.Zone == _zone); } ); if (findcs != null) { int num = int.Parse(findcs.CRCNum.Substring(3, 3)) - 1; int cell = 225; //堆垛机载体 g.FillRectangle(brush = new SolidBrush(co.connectstatus == 1 ? Color.Green : Color.Gray), 20 + num * cell, 241, 120, 12); //堆垛机滚轮 g.DrawEllipse(pen = new Pen(brush = new SolidBrush(Color.Black), 1), 25 + num * cell, 247, 9, 9); g.FillEllipse(brush = new SolidBrush(Color.Black), 25 + num * cell, 247, 9, 9); g.DrawEllipse(pen = new Pen(brush = new SolidBrush(Color.Black), 1), 125 + num * cell, 247, 9, 9); g.FillEllipse(brush = new SolidBrush(Color.Black), 125 + num * cell, 247, 9, 9); //堆垛机主臂 g.FillRectangle(brush = new SolidBrush(co.connectstatus == 1 ? Color.Green : Color.Gray), 70 + num * cell, 45, 16, 204); //堆垛机电柜 g.FillRectangle(brush = new SolidBrush(Color.SlateGray), 100 + num * cell, 181, 22, 60); g.DrawString(findcs.CRCNum.Substring(5, 1), new Font("宋体", 12, FontStyle.Bold), brush = new SolidBrush(Color.Blue), 103 + num * cell, 185); //堆垛机爬梯 for (int i = 45; i < 243; i = i + 11) { g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.SlateGray), 1), 87 + num * cell, i, 10, 10); } //爬梯与电柜的连接体 g.DrawLine(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 85 + num * cell, 201, 100 + num * cell, 201); //堆垛机货叉 g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 22 + num * cell, 240, 41, 3); g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 60 + num * cell, 220, 3, 20); g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 60 + num * cell, 230, 20, 4); //g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 22 + num * cell, (130 - 11 * int.Parse(string.IsNullOrEmpty(findcs.RackLevel) ? "0" : findcs.RackLevel)) + 110, 41, 3); //g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 60 + num * cell, (130 - 11 * int.Parse(string.IsNullOrEmpty(findcs.RackLevel) ? "0" : findcs.RackLevel)) + 90, 3, 20); //g.DrawRectangle(pen = new Pen(brush = new SolidBrush(Color.Black), 4), 60 + num * cell, (130 - 11 * int.Parse(string.IsNullOrEmpty(findcs.RackLevel) ? "0" : findcs.RackLevel)) + 100, 20, 4); //货物及任务号 if (int.Parse(findcs.TaskNo) != 0) { if (int.Parse(findcs.FunctionReport) > 113) { g.FillRectangle(brush = new SolidBrush(Color.Chocolate), 25 + num * cell, 215, 30, 22); //(130 - 11 * int.Parse(string.IsNullOrEmpty(findcs.RackLevel) ? "0" : findcs.RackLevel)) + 85 } pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; //恢复实线 pen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor; //定义线尾的样式为箭头 pen.Width = 6; if (int.Parse(findcs.FunctionReport) == 114) //取货箭头 { g.DrawLine(pen, 2 + num * cell, 215, 17 + num * cell, 215); } else if (int.Parse(findcs.FunctionReport) == 130)//放货箭头 { g.DrawLine(pen, 17 + num * cell, 215, 2 + num * cell, 215); } else { g.FillRectangle(brush = new SolidBrush(Color.Silver), 2 + num * cell, 215, 15, 10); } //g.DrawString(findcs.Palletnu.ToString(), new Font("宋体", 11, FontStyle.Bold), brush = new SolidBrush(Color.Blue), 13 + num * cell, (130 - 11 * int.Parse(string.IsNullOrEmpty(findcs.RackLevel) ? "0" : findcs.RackLevel)) + 88); //strPalletNu = findcs.Palletnu.ToString(); } else { g.FillRectangle(brush = new SolidBrush(Color.Silver), 25 + num * cell, 141, 30, 22); } //状态信息及报警信息 if (findcs.LabelInfo != null) { string[] info = findcs.LabelInfo.Split(new char[] { '.' }); for (int i = 0; i < info.Length - 1; i++) { if (i == 4 && info[i].Contains("停")) { g.DrawString(info[i], new Font("宋体", 10, FontStyle.Regular), brush = new SolidBrush(Color.Red), 20 + num * cell, 263 + 20 * i); } else if (i == 3 && (info[i] == "手动操作" || info[i].Contains("未") || info[i] == "状态:报警停机" || info[i] == "状态:Socket断开!")) { g.DrawString(info[i], new Font("宋体", 10, FontStyle.Regular), brush = new SolidBrush(Color.Red), 20 + num * cell, 263 + 20 * i); } else { g.DrawString(info[i], new Font("宋体", 10, FontStyle.Regular), brush = new SolidBrush(Color.Blue), 20 + num * cell, 263 + 20 * i); } } //for (int j = 0; j < info[info.Length - 1].Length/8; j++) //{ if (!string.IsNullOrEmpty(info[info.Length - 1]) && info[info.Length - 1].ToString() != "无故障") { string[] alarminfo = info[info.Length - 1].Split('|'); g.DrawString(alarminfo[0], new Font("宋体", 10, FontStyle.Regular), brush = new SolidBrush(Color.Red), 20 + num * cell, 263 + 20 * (info.Length - 1) + 8); } //} } } } brush.Dispose(); pen.Dispose(); g.Dispose(); GC.Collect(); } } catch { } }