winform 曲线(贝塞尔) 分类: WinForm 2014-12-29 16:52 109人阅读 评论(0) 收藏

时间:2021-09-12 14:17:11
<span style="font-size:14px;">//覆盖OnPaint事件</span>
<span style="font-size:14px;"> protected override void OnPaint(PaintEventArgs e) {
Graphics g = e.Graphics;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality & System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
//用四个Label的位置作为四个点
Point a = new Point(label1.Location.X, label1.Location.Y); //起始点
Point z1 = new Point(label2.Location.X, label2.Location.Y); //控制点
Point z2 = new Point(label3.Location.X, label3.Location.Y); //控制点
Point b = new Point(label4.Location.X, label4.Location.Y); //结束点
//通过调整控制点可以调整曲线的弯曲程度
g.DrawBezier(Pens.Red, a, z1, z2, b);
}</span>

图示:

winform 曲线(贝塞尔)                                                    分类:            WinForm             2014-12-29 16:52    109人阅读    评论(0)    收藏

有关贝塞尔曲线的,这个博客不错:( http://blog.csdn.net/conmajia/article/details/8543834):

版权声明:本文为博主原创文章,未经博主允许不得转载。