Protected Overrides Sub onpaint(ByVal e As System.Windows.Forms.PaintEventArgs)
注释://///////////绘制任意直线
Dim g As Graphics = e.Graphics
Dim mypen As Pen = New Pen(Color.Red, 2)
g.DrawLine(mypen, 100, 100, 10, 10)
注释://///////////绘制矩形(任意直线构成的封闭图形)
Dim point1 As PointF = New PointF(100F, 100F)
Dim point2 As PointF = New PointF(200F, 100F)
Dim point3 As PointF = New PointF(200F, 200F)
Dim point4 As PointF = New PointF(100F, 200F)
Dim curvepoints As PointF() = {point1, point2, point3, point4}
g.DrawPolygon(New Pen(Color.Blue, 2), curvepoints)
注释:////////////文本表示
Dim FFamily As FontFamily = New FontFamily("Arial")
Dim font As Font = New Font(FFamily, "20", FontStyle.Bold, FontStyle.Italic,GraphicsUnit.Pixel)
Dim text As String = "I love you!"
Dim solidbrush As SolidBrush = New SolidBrush(Color.Red)
Dim pr As PointF = New PointF(100, 10)
e.Graphics.DrawString(text, font, solidbrush, pr)
注释:////////////平面绘制
Dim rec As RectangleF = New RectangleF(10, 10, 200, 100)
g.DrawPie(mypen, rec, 150, 150)
注释:///////////封闭图形,0.7应该是个圆
g.DrawClosedCurve(mypen, curvepoints, 0.7,Drawing.Drawing2D.FillMode.Alternate)
注释:///////////大家自己试试看吧
g.DrawArc(mypen, 300, 300, 200, 200, 100, 100)
g.DrawCurve(mypen, curvepoints)
g.DrawBezier(mypen, 50, 50, 100, 50, 100, 100, 50, 100)
g.DrawBeziers(mypen, curvepoints)
注释://////////这可是一个圆
Dim rec1 As RectangleF = New RectangleF(10, 10, 100, 100)
g.DrawEllipse(mypen, rec1)
注释://////////这是一个椭圆
Dim rec2 As RectangleF = New RectangleF(10, 10, 200, 100)
g.DrawEllipse(mypen, rec2)
End Sub
这些是我自己试验出来的,当然了,还有好多,我只是开了一个头,大家要是发现什么好东东,别忘了通知一下:)
用VB.NET绘制GDI图形
来源:
作者:
时间:2007-06-14
点击:
最新评论共有 0 位网友发表了评论
查看所有评论
发表评论
- 赞助商连接
热点关注
- VB与ActiveX控件签名谈
- Autodesk官方最新的.NET教
- 不打开EXCEL导出EXCEL报表
- NUnit学习笔记 VS.net 200
- 在VB中使用水晶报表的一种
- VB.NET时间日期数据处理及
- VB.NET中LISTVIEW排序
- VB.NET开发人员必备参考10
- vb.net中不需要EXCEL导出
- vs.net 2005中web.config
- Visual Basic编程规范
- VB中如何修改treeview的背
- VB中获取指定打印机的各种
- 用vb.net实现写字板程序报
- VB外接程序的制做-在VB中
- 显示自定义动画鼠标或彩色
- 一个vb.net的用户登陆页面
- VB.NET数据库编程中的图形
- vb.net 防止MDI子窗体被多
- VB外接程序的设计- 得到VB