コード例 #1
0
        private void DrawPicBox()
        {
            var g = PicStat.CreateGraphics();

            g.Clear(Primary);
            if (statSentQueue.Count > 0)
            {
                var bpp = Math.Max(statSentQueue.Max(), statRecvQueue.Max()) / (histMaxHeight * 0.9);
                g.DrawLine(Pens.White, 0, centerY, 284, centerY);
                for (var i = 1; i <= statSentQueue.Count; i++)
                {
                    var height = statSentQueue[statSentQueue.Count - i] / bpp;
                    g.FillRectangle(_histogramBrush, 284 - histWidth * i, (float)(centerY - height), histWidth, (float)height);
                    height = statRecvQueue[statRecvQueue.Count - i] / bpp;
                    g.FillRectangle(_histogramBrush, 284 - histWidth * i, centerY, histWidth, (float)height);
                }
                g.DrawString($"Out: {SpeedString(statSentQueue.Last())}", _statusFont, _statusBrush, new PointF(284, 25), _rightAlignFormat);
                g.DrawString($"In: {SpeedString(statRecvQueue.Last())}", _statusFont, _statusBrush, new PointF(284, 246), _rightAlignFormat);
            }


            if (_picHover)
            {
                DrawHover(g);
            }
        }
コード例 #2
0
 private void Reset(object sender, EventArgs ea)
 {
     Invoke(new Action <object, EventArgs>((s, e) => {
         bVpnSwitch.Show();
         StatTimer.Stop();
         PicStat.CreateGraphics().Clear(Primary);
         lbCurrentProfileName.Show();
         MenuItemManageProfile.Enabled = true;
         MenuItemChooseProfile.Enabled = true;
     }), sender, ea);
 }
コード例 #3
0
 private void DrawHover()
 {
     DrawHover(PicStat.CreateGraphics());
 }