VB.net與VB不同。
創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設(shè),高郵企業(yè)網(wǎng)站建設(shè),高郵品牌網(wǎng)站建設(shè),網(wǎng)站定制,高郵網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷(xiāo),網(wǎng)絡(luò)優(yōu)化,高郵網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M(mǎn)足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專(zhuān)業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶(hù)成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。
VB.net已經(jīng)有專(zhuān)門(mén)繪圖的類(lèi)。
可以定義筆刷然后用Drawing類(lèi)中的方法繪制。
Private Sub DrawEllipse()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawEllipse(myPen, New Rectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
End Sub
Private Sub DrawRectangle()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawRectangle(myPen, New Rectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
End Sub
你可以在窗體上放一個(gè)lable控件,取名叫l(wèi)able1,
那么實(shí)現(xiàn)方式就是:
private
sub
form_load()
lable1.text="今天天氣很好";
end
sub
你可以試試
下面的例子通過(guò)重載Form 窗體的OnPaint()方法繪制GDI圖形Protected Overrides Sub onpaint(ByVal e As System Windows Forms PaintEventArgs)注釋 /////////////繪制任意直線(xiàn)Dim g As Graphics = e GraphicsDim mypen As Pen = New Pen(Color Red )g DrawLine(mypen )注釋 /////////////繪制矩形(任意直線(xiàn)構(gòu)成的封閉圖形)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 }g DrawPolygon(New Pen(Color Blue ) curvepoints)注釋 ////////////文本表示Dim FFamily As FontFamily = New FontFamily( Arial )Dim font As Font = New Font(FFamily 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( )e Graphics DrawString(text font solidbrush pr)注釋 ////////////平面繪制Dim rec As RectangleF = New RectangleF( )g DrawPie(mypen rec )注釋 ///////////封閉圖形 應(yīng)該是個(gè)圓g DrawClosedCurve(mypen curvepoints Drawing Drawing D FillMode Alternate)注釋 ///////////大家自己試試看吧g DrawArc(mypen )g DrawCurve(mypen curvepoints)g DrawBezier(mypen )g DrawBeziers(mypen curvepoints)注釋 //////////這可是一個(gè)圓Dim rec As RectangleF = New RectangleF( )g DrawEllipse(mypen rec )注釋 //////////這是一個(gè)橢圓Dim rec As RectangleF = New RectangleF( )g DrawEllipse(mypen rec )End Sub 這些是我自己試驗(yàn)出來(lái)的 當(dāng)然了 還有好多 我只是開(kāi)了一個(gè)頭 大家要是發(fā)現(xiàn)什么好東東 別忘了通知一下 ) lishixinzhi/Article/program/net/201311/11800