下面的例子通过重载Form
窗体的OnPaint()方法绘制GDI图形
Protected Overrides Sub onpaint(ByVal e As SystemWindowsFormsPaintEventArgs)
注释/////////////绘制任意直线
Dim g As Graphics = eGraphics
Dim mypen As Pen = New Pen(ColorRed )
gDrawLine(mypen )
注释/////////////绘制矩形(任意直线构成的封闭图形)
Dim point As PointF = New PointF(F F)
Dim point As PointF = New PointF(F F)
Dim point As PointF = New PointF(F F)
Dim point As PointF = New PointF(F F)
Dim curvepoints As PointF() = {point point point point}
gDrawPolygon(New Pen(ColorBlue ) curvepoints)
注释////////////文本表示
Dim FFamily As FontFamily = New FontFamily(Arial)
Dim font As Font = New Font(FFamily FontStyleBold FontStyleItalic GraphicsUnitPixel)
Dim text As String = I love you!
Dim solidbrush As SolidBrush = New SolidBrush(ColorRed)
Dim pr As PointF = New PointF( )
eGraphicsDrawString(text font solidbrush pr)
注释////////////平面绘制
Dim rec As RectangleF = New RectangleF( )
gDrawPie(mypen rec )
注释///////////封闭图形应该是个圆
gDrawClosedCurve(mypen curvepoints DrawingDrawingDFillModeAlternate)
注释///////////大家自己试试看吧
gDrawArc(mypen )
gDrawCurve(mypen curvepoints)
gDrawBezier(mypen )
gDrawBeziers(mypen curvepoints)
注释//////////这可是一个圆
Dim rec As RectangleF = New RectangleF( )
gDrawEllipse(mypen rec)
注释//////////这是一个椭圆
Dim rec As RectangleF = New RectangleF( )
gDrawEllipse(mypen rec)
End Sub
这些是我自己试验出来的当然了还有好多我只是开了一个头大家要是发现什么好东东别忘了通知一下)