好长时间没来csdn了,也不知道这里的兄弟们怎么样了,!先再这儿向各位问一声好!
呵呵!
兄弟我现在有一个问题,关于gdi+的,想请兄弟们帮帮忙,谢谢!
谁都知道同时按下Ctrl+Alt+Delete会出现Windows任务管理器,当选择"性能"选择项卡时,会出现"CPU使用记录"的图示,我想请教各位这样的图示在程序中怎么实现?麻烦知道的兄弟帮帮忙,或者给一些提示也行!
万分感谢!
呵呵!
兄弟我现在有一个问题,关于gdi+的,想请兄弟们帮帮忙,谢谢!
谁都知道同时按下Ctrl+Alt+Delete会出现Windows任务管理器,当选择"性能"选择项卡时,会出现"CPU使用记录"的图示,我想请教各位这样的图示在程序中怎么实现?麻烦知道的兄弟帮帮忙,或者给一些提示也行!
万分感谢!
解决方案 »
- 关于截取字符串问题
- 诚心请教视频网站的问题
- DataGridView中删除数据的问题
- 再问一个字符串查找的问题
- 高分 急 一般人都会的比较问题 牛人勿进
- C#将指定目录下的文件夹和文件生成一个目录树显示到一个treeView控件中的代码
- 怎样得到一个变量的数据类型?
- 这两个构造函数能否合为一个,只有一个参数类型不同,函数体完全相同
- 问个简单问题!!什么是强类型编程!!
- 收集EXCEL导入到DATAGRIDVIEW控件与从DataGridView控件导出EXCEL的方法
- 向高手请教:要向Access中的两个表(表A,表B)插入记录,其中表A的某字段引用表B的主键作为外键,请问如何编写C#事务???谢谢指点!!!
- 高手进来帮忙,新手进来学习!
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;
}
}
}
下面是我的申请贴
http://community.csdn.net/Expert/topic/5369/5369138.xml?temp=.8303949
能不能说的详细一点啊?最好能给我个示例看看,谢谢
Form1_Paint中用GDI+画,也不是定时刷新图表,而是定时去查查你要画的数据,然后调用form.Invalide
我记得在SetStyle中可以设置一个值,
一有改动就自动刷新,执行OnPaint
http://hi.baidu.com/zhihongf
使用Double-Buffer来实现无闪烁动态折线图
http://blog.csdn.net/Knight94/archive/2006/08/18/1094078.aspx