惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 易学

Control Panel Shortcuts 基于LMS8962的跑马灯教学程序——定时器、串口及GPIO的使用 使用SerialPort及ZedGraph快速实现串口数据实时显示 基于.NET Compact Framework的实时曲线绘制控件 在Windows mobile 6.0模拟器中实现蓝牙数据采集 Firmata解析 多线程环境下的UI异步操作 定制带有模拟器且支持ActiveSync调试的WINCE5.0 SDK XPE及CE系统对比 西溪湿地(摘录) - 易学 - 博客园 当前电子鼻系统数据处理中常用的模式识别技术 各大公司样片申请指南 数字万用表集成块的代换技巧 AD855x系列在微弱信号检测中的应用 测试Live Writer能否直接发图片 Radial 射线 昆明理工大学博士、硕士论文撰写规范 “共轭变换”图像处理算法在FPGA 上实现的研究
WinCE下动态显示绘图控件
易学 · 2009-10-29 · via 博客园 - 易学

一、要点

    本控件解决了CE下绘图闪烁的问题

二、源代码

namespace RealTimeGraphCtlCF

{

public partial class GraphPane : UserControl

{

private Graphics gHdc;

private XAxis xAxis;

private YAxis yAxis;

private int _xMax;

[EditorBrowsable(EditorBrowsableState.Always)]

[DefaultValue(100)]

public int XAxisMax

{

get { return _xMax; }

set { _xMax = value; }

}

private int _yMax;

[EditorBrowsable(EditorBrowsableState.Always)]

[DefaultValue(100)]

public int YAxisMax

{

get { return _yMax; }

set { _yMax = value; }

}

private string _xTitle = "X";

[EditorBrowsable(EditorBrowsableState.Always)]

[DefaultValue("X")]

public string XAxisTitle

{

get { return _xTitle; }

set { _xTitle = value; }

}

private string _yTitle = "Y";

[EditorBrowsable(EditorBrowsableState.Always)]

[DefaultValue("Y")]

public string YAxisTitle

{

get { return _yTitle; }

set { _yTitle = value; }

}

private int _xTicCount = 100;

[EditorBrowsable(EditorBrowsableState.Always)]

[DefaultValue(100)]

public int XAxisTicCount

{

get { return _xTicCount; }

set { _xTicCount = value; }

}

private int _yTicCount = 100;

[EditorBrowsable(EditorBrowsableState.Always)]

[DefaultValue(100)]

public int YAxisTicCount

{

get { return _yTicCount; }

set { _yTicCount = value; }

}

private Pen _linePen;

[EditorBrowsable(EditorBrowsableState.Never)]

public Pen LinePen

{

get { return _linePen; }

set { _linePen = value; }

}

public List<Point> PointList;

private const int ticLength = 2;

public GraphPane()

{

InitializeComponent();

this.PointList = new List<Point>();

this._linePen = new Pen(Color.Black, 1);

}

private void GraphPane_Paint(object sender, PaintEventArgs e)

{

Bitmap b = new Bitmap(this.Width, this.Height);

gHdc = Graphics.FromImage((System.Drawing.Image)b);

gHdc.FillRectangle(new SolidBrush(Color.White), this.ClientRectangle);

Point orgin = new Point(20, 20);

int yAxisLength = ClientRectangle.Height - 2 * orgin.Y;

yAxis = new YAxis(gHdc, this.ClientRectangle, orgin, yAxisLength, _yMax, _yTitle);

yAxis.Draw(_yTicCount, ticLength);

int xAxisLength = ClientRectangle.Width - 2 * orgin.X;

xAxis = new XAxis(gHdc, this.ClientRectangle, orgin, xAxisLength, _xMax, _xTitle);

xAxis.Draw(_xTicCount, ticLength);

DrawLines(gHdc);

e.Graphics.DrawImage((System.Drawing.Image)b, 0, 0);

b.Dispose();

}

public void DrawLines(Graphics gHdc)

{

Point previous = new Point();

Point current = new Point();

if (PointList.Count >= 2)

{

previous = PointList[0];

for (int i = 1; i < PointList.Count; i++)

{

current = PointList[i];

gHdc.DrawLine(LinePen, previous.X, previous.Y, current.X, current.Y);

previous = current;

}

}

}

protected override void OnPaintBackground(PaintEventArgs e)

{

}

}

}

三、参考文献

http://blog.csdn.net/yefanqiu/archive/2006/11/21/1402520.aspx