| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 763 人关注过本帖
标题:gdi+画连续线问题!
只看楼主 加入收藏
雪山的猫
Rank: 1
等 级:新手上路
帖 子:44
专家分:5
注 册:2012-12-23
结帖率:95.24%
收藏
 问题点数:0 回复次数:1 
gdi+画连续线问题!
我想用gdi+绘出连续线,但是gdi+貌似没有给出相应的函数,而cdc的算法又不行。求帮助!好人一生平安呀!
搜索更多相关主题的帖子: 平安 
2013-08-26 09:26
zhuhaijyy
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-9-18
收藏
得分:0 
测试这段代码
Dim g As Graphics = PictureBox1.CreateGraphics()

        Dim blackpen As New Pen(Color.CadetBlue, 3)
        'g.DrawLine(blackpen, 10, 10, 20, 10)
        'g.DrawLine(Pens.Yellow, 10, 10, 20, 10)
        Dim point1 As New Point(30, 20)
        Dim point2 As New Point(60, 150)
        Dim point3 As New Point(120, 30)
        Dim point4 As New Point(190, 60)
        Dim point5 As New Point(200, 140)
        Dim point6 As New Point(220, 100)
        Dim point7 As New Point(250, 40)
        Dim point8 As New Point(280, 100)
        Dim cupoints As Point() = {point1, point2, point3, point4, point5, point6}
        g.DrawCurve(blackpen, cupoints, 0.3F)
        ' g.DrawBezier(blackpen, point1, point2, point3, point4)

        Dim bezierPoints As Point() = {point1, point2, point3, point4, point5, point6, point7}
        g.DrawBeziers(Pens.Coral, bezierPoints)
        Dim MyPen As New Pen(Color.Black, 1)
        Dim MyRPen As New Pen(Color.Red, 3)
        'MyPen.EndCap = LineCap.AnchorMask
        'MyPen.EndCap = LineCap.ArrowAnchor
        ' MyPen.EndCap = LineCap.Triangle
        ' MyPen.EndCap = LineCap.RoundAnchor
        ' MyPen.EndCap = LineCap.SquareAnchor
        'g.DrawLine(MyPen, point1, point2)
        'g.DrawLine(MyPen, point2, point3)
        'g.DrawLine(MyPen, point3, point4)
        'g.DrawLine(MyPen, point4, point5)
        'g.DrawLine(MyPen, point5, point6)
        'g.DrawLine(MyPen, point6, point7)
        g.DrawLines(MyPen, cupoints)
        g.DrawLine(MyRPen, point1.X, point1.Y, (point1.X + 3), point1.Y)
        g.DrawLine(MyRPen, point2.X, point2.Y, (point2.X + 3), point2.Y)
        g.DrawLine(MyRPen, point3.X, point3.Y, (point3.X + 3), point3.Y)
        g.DrawLine(MyRPen, point4.X, point4.Y, (point4.X + 3), point4.Y)
        g.DrawLine(MyRPen, point5.X, point5.Y, (point5.X + 3), point5.Y)
        g.DrawLine(MyRPen, point6.X, point6.Y, (point6.X + 3), point6.Y)

        blackpen.Dispose()
        MyPen.Dispose()
        g.Dispose()
2013-09-18 11:03
快速回复:gdi+画连续线问题!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.032131 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved