好长时间没来csdn了,也不知道这里的兄弟们怎么样了,!先再这儿向各位问一声好!
呵呵!
兄弟我现在有一个问题,关于gdi+的,想请兄弟们帮帮忙,谢谢!
谁都知道同时按下Ctrl+Alt+Delete会出现Windows任务管理器,当选择"性能"选择项卡时,会出现"CPU使用记录"的图示,我想请教各位这样的图示在程序中怎么实现?麻烦知道的兄弟帮帮忙,或者给一些提示也行!
万分感谢!

解决方案 »

  1.   

    //啥也不说了,看效果吧
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;namespace WindowsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }        private List<byte> 数据采样 = new List<byte>();
            private int 网格偏移 = 0;
            private Random 随机数 = new Random();
            private const int 网格大小 = 12;
            private Pen 网格颜色 = new Pen(Color.FromArgb(0x00, 0x80, 0x40));
            private Pen 曲线颜色 = new Pen(Color.FromArgb(0x00, 0xFF, 0x00));
            private void timer1_Tick(object sender, EventArgs e)
            {
                while (数据采样.Count > 1000) 数据采样.RemoveAt(0);
                数据采样.Add((byte)随机数.Next(256));
                网格偏移 = (网格偏移 + 1) % 网格大小;
                Invalidate();
            }        private void Form1_Paint(object sender, PaintEventArgs e)
            {
                e.Graphics.FillRectangle(Brushes.Black, e.Graphics.ClipBounds);
                #region 绘制网格
                for (int i = ClientSize.Width - 网格偏移; i >= 0; i -= 网格大小)
                    e.Graphics.DrawLine(网格颜色, i, 0, i, ClientSize.Height);
                for (int i = ClientSize.Height; i >= 0; i -= 网格大小)
                    e.Graphics.DrawLine(网格颜色, 0, i, ClientSize.Width, i);
                #endregion            #region 绘制曲线
                if (数据采样.Count <= 1) return; // 一个数据就不绘制了
                byte A = 数据采样[数据采样.Count - 1];
                for (int i = 数据采样.Count - 2; i >= 0; i--)
                {
                    byte B = 数据采样[i];
                    e.Graphics.DrawLine(曲线颜色,
                        new Point(ClientSize.Width - 数据采样.Count + i - 1, 
                            (int)(((double)A / 255) * ClientSize.Height)),
                        new Point(ClientSize.Width - 数据采样.Count + i,
                            (int)(((double)B / 255) * ClientSize.Height)));
                    A = B;
                }
                #endregion
            }        private void Form1_Resize(object sender, EventArgs e)
            {
                Invalidate(); // 如果觉得闪动厉害就用开双缓冲
            }        private void Form1_Load(object sender, EventArgs e)
            {
                DoubleBuffered = true;
                timer1.Enabled = true;
                timer1.Interval = 100;
            }
        }
    }
      

  2.   

    这个是定时刷新图表的功能见我们的图表产品演示http://www.isoftone.com/product/ichart/?tab=product_service&catalog=spc大家到图表区支持我任图表区版主啊,更多的为大家技术服务。
    下面是我的申请贴
    http://community.csdn.net/Expert/topic/5369/5369138.xml?temp=.8303949
      

  3.   

    to:sunrobust(咸鱼) 
    能不能说的详细一点啊?最好能给我个示例看看,谢谢
      

  4.   

    to:liuziran(.NET图表组件开发商 http://www.isoftone.com) 意思正和你说的差不多,能不能给我一点思路啊???谢谢
      

  5.   

    记得CODEPROJECT上有,忘了项目名叫什么了
      

  6.   

    主要是在
    Form1_Paint中用GDI+画,也不是定时刷新图表,而是定时去查查你要画的数据,然后调用form.Invalide
      

  7.   

    定时刷新就成,
    我记得在SetStyle中可以设置一个值,
    一有改动就自动刷新,执行OnPaint
      

  8.   

    这里有楼主需要
    http://hi.baidu.com/zhihongf
      

  9.   

    顶 & 谢谢楼主和hertcloud(·£孙子兵法£·) ,正需要这些东东。
      

  10.   


    使用Double-Buffer来实现无闪烁动态折线图
    http://blog.csdn.net/Knight94/archive/2006/08/18/1094078.aspx