private void _guazi_MessageRecv(string user_name, string comment, int color, int user_level, string medal_name, int medal_level, string title_name, bool is_vip) { _comment_count++; _total_comment_count++; _global_total_comment_count++; var csc = new ColorStringCollection(); if (user_level > 0) { csc.Add(Color.Purple, "[UL" + user_level + "]"); } if (!string.IsNullOrEmpty(medal_name) && medal_level > 0) { csc.Add(Color.Green, "[" + medal_name + medal_level + "]"); } if (is_vip) { csc.Add(Color.Red, user_name + " :"); } else { csc.Add(Color.Gray, user_name + " :"); } csc.Add(Color.Black, comment); Invoke(new NoArgSTA(delegate { _commentGr.AddLine(csc); pCommentOutput.Image = _commentGr.GetImage(); })); }
private void _guazi_LiveRecv() { var csc = new ColorStringCollection(); csc.Add(Color.Blue, "<直播已开始>"); Invoke(new NoArgSTA(delegate { _commentGr.AddLine(csc); pCommentOutput.Image = _commentGr.GetImage(); })); }
private void _guazi_SysMsgRecv(string arg) { var csc = new ColorStringCollection(); csc.Add(Color.Blue, "收到系统消息: "); csc.Add(Color.Black, arg.Replace(":?", "")); Invoke(new NoArgSTA(delegate { _commentGr.AddLine(csc); pCommentOutput.Image = _commentGr.GetImage(); })); }
private void _guazi_SmallTVJoined(int roomid, int tv_id) { var csc = new ColorStringCollection(); csc.Add(Color.Blue, "已参加"); csc.Add(Color.Black, roomid.ToString()); csc.Add(Color.Blue, "房间的小电视抽奖"); Invoke(new NoArgSTA(delegate { _commentGr.AddLine(csc); pCommentOutput.Image = _commentGr.GetImage(); })); }
private void _guazi_RoomBlockMsgRecv(string arg) { var csc = new ColorStringCollection(); csc.Add(Color.Blue, "<已屏蔽"); csc.Add(Color.Black, arg); csc.Add(Color.Blue, "的消息>"); Invoke(new NoArgSTA(delegate { _commentGr.AddLine(csc); pCommentOutput.Image = _commentGr.GetImage(); })); }
private void _guazi_WelcomeRecv(string user_name, int uid, int is_admin, int is_vip) { return; var csc = new ColorStringCollection(); csc.Add(Color.Red, user_name); csc.Add(Color.Gray, "进入直播间"); Invoke(new NoArgSTA(delegate { _commentGr.AddLine(csc); pCommentOutput.Image = _commentGr.GetImage(); })); }
public void AddLine(ColorStringCollection csc) { var bmp = new Bitmap(1, 1); var gr = Graphics.FromImage(bmp); PointF pt = new PointF(0, 0); SizeF size = new SizeF(_width - _ScrollerWidth, _height); foreach (var item in csc) { var brush = new SolidBrush(item.Key); DrawString(gr, item.Value, _defaultFont, brush, ref pt, size); } gr.Dispose(); if (pt.X > 0) { pt.X = 0; pt.Y += _singleLineHeight; } _stringList.Add(csc); _heightList.Add(pt.Y); _totalHeight += pt.Y; if (_currentIndex == -1) { _currentHeight += pt.Y; } if (_stringList.Count > _max_item_count) { _totalHeight -= _heightList[0]; //if (_currentIndex == 0) _currentHeight -= _heightList[0]; _currentHeight -= _heightList[0]; if (_currentHeight < 0) { _currentHeight = 0; } if (_currentIndex > 0) { _currentIndex--; } _heightList.RemoveAt(0); _stringList.RemoveAt(0); } }
private void _guazi_GiftRecv(string user_name, string gift_name, int gift_num, int gift_id, int price) { int worth = gift_num * price; _gift_price += worth; _total_gift_price += worth; _global_total_gift_price += (uint)worth; return; if (worth >= 1000) { var csc = new ColorStringCollection(); csc.Add(Color.Orange, user_name); csc.Add(Color.Gray, "赠送"); csc.Add(Color.Chocolate, gift_name + "×" + gift_num); Invoke(new NoArgSTA(delegate { _commentGr.AddLine(csc); pCommentOutput.Image = _commentGr.GetImage(); })); } }