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

推荐订阅源

U
Unit 42
N
News and Events Feed by Topic
S
Schneier on Security
G
GRAHAM CLULEY
Scott Helme
Scott Helme
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CERT Recently Published Vulnerability Notes
T
The Exploit Database - CXSecurity.com
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
P
Privacy & Cybersecurity Law Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 司徒正美
Blog — PlanetScale
Blog — PlanetScale
Project Zero
Project Zero
MyScale Blog
MyScale Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
The Last Watchdog
The Last Watchdog
Vercel News
Vercel News
The Cloudflare Blog
C
Check Point Blog
Help Net Security
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
NISL@THU
NISL@THU
S
Security @ Cisco Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
SegmentFault 最新的问题
MongoDB | Blog
MongoDB | Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
AWS News Blog
AWS News Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
PCI Perspectives
PCI Perspectives
S
Securelist
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Vulnerabilities – Threatpost
S
Secure Thoughts

博客园 - 易学

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