public string getHandonRepeated() { string result = ""; ArrayList akeys = new ArrayList(stuPushCount.Keys); //Hashtable akeys.Sort(); //按字母顺序进行排序 foreach (int seat in akeys) { StudentInfo si = Global.getUserInfoBySeat(seat); if (si == null) { continue; } string uid = si.ID; int count = (int)stuPushCount[seat]; string pair = uid + ":" + count; if (count <= 3) { continue; } result += (result.Length > 0 ? "," : "") + pair; } return(result); }
private void Theout(object sender, System.Timers.ElapsedEventArgs e) { if (Interlocked.Exchange(ref inTimer, 1) == 0) { string data = Common.GetHandon(); data = Global.RaiseStu; Global.RaiseStu = ""; if (data.Length > 0) { Log.Info("xiti.get=" + data); DateTime tm_now = DateTime.Now; TimeSpan createtimespan = new TimeSpan(tm_create.Ticks); TimeSpan nowtimespan = new TimeSpan(tm_now.Ticks); TimeSpan timespan = nowtimespan.Subtract(createtimespan).Duration(); int timeDiff = timespan.Minutes * 60 + timespan.Seconds; for (int i = 0; i < data.Split('|').Length; i++) { // int num = Util.toInt(data.Split('|')[i]); int num = Util.toInt(Global.getSeatByCardid(data.Split('|')[i])); string context = num + ":" + timeDiff; Log.Info("QiangDa.item=" + context); string name = ""; string imgurl = ""; StudentInfo si = Global.getUserInfoBySeat(num); if (si != null && i == 0) ///添加i==0条件,解决抢答前后端显示不一样问题; { name = si.Name; imgurl = si.imageurl; } else { continue; } Log.Info("HandonEvent. id=" + num + ", imgurl=" + imgurl); HandonEvent(num, name, imgurl, pictureBox_headImage); StopT(); } //Httpd.NotifyVoteEvent(); } Interlocked.Exchange(ref inTimer, 0); } }
public void ShowHistoryImage(string path, int index) { m_ShowHistoryImage = true; StudentInfo si = Global.getUserInfoBySeat(index); if (si != null) { labelName.Text = si.Name; labelIndex.Text = index + ""; } //清空界面 Graphics grap = this.panel1.CreateGraphics(); grap.Clear(this.BackColor); System.Drawing.Image originalImg = System.Drawing.Image.FromFile(path); System.Drawing.Rectangle destRect = new System.Drawing.Rectangle(new System.Drawing.Point(0, 0), new System.Drawing.Size(panel1.Width, panel1.Height)); //目标位置 System.Drawing.Rectangle origRect = new System.Drawing.Rectangle(new System.Drawing.Point(panel1.Left, panel1.Top), new System.Drawing.Size(panel1.Width, panel1.Height)); //原图位置(默认从原图中截取的图片大小等于目标图片的大小) grap.DrawImage(originalImg, destRect, origRect, System.Drawing.GraphicsUnit.Pixel); grap.Dispose(); }
public void ShowPenTrail(int index) { int seat = index + 1; this.Show(); this.BringToFront(); //if (m_index == index) // return; m_ShowHistoryImage = false; StudentInfo si = Global.getUserInfoBySeat(seat); if (si != null) { labelName.Text = si.Name; labelIndex.Text = seat + ""; } m_index = index; m_dDrawing = false; //清空界面 // Graphics grap = Graphics.FromImage(panelImg); Graphics grap = this.panel1.CreateGraphics(); grap.Clear(this.BackColor); System.Drawing.Image originalImg = szBMP[index]; if (originalImg != null) { System.Drawing.Rectangle destRect = new System.Drawing.Rectangle(new System.Drawing.Point(0, 0), new System.Drawing.Size(panel1.Width, panel1.Height)); //目标位置 System.Drawing.Rectangle origRect = new System.Drawing.Rectangle(new System.Drawing.Point(panel1.Left, panel1.Top), new System.Drawing.Size(panel1.Width, panel1.Height)); //原图位置(默认从原图中截取的图片大小等于目标图片的大小) grap.DrawImage(originalImg, destRect, origRect, System.Drawing.GraphicsUnit.Pixel); } grap.Dispose(); this.panel1.BackgroundImage = panelImg; }