偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

淺析VB.NET繪制GDI圖形的方法

開發(fā) 后端
這里介紹用VB.NET繪制GDI圖形,Visual Basic.NET是基于微軟.NET Framework之上的面向?qū)ο蟮闹虚g解釋性語言,可以看作是Visual Basic在.Net Framework平臺上的升級版本,增強了對面向?qū)ο蟮闹С帧?/div>

在向大家詳細(xì)介紹用VB.NET繪制GDI圖形之前,首先讓大家了解下VB.NET是什么,然后全面介紹VB.NET繪制GDI圖形。

Visual Basic.NET是基于微軟.NET Framework之上的面向?qū)ο蟮闹虚g解釋性語言,可以看作是Visual Basic在.Net Framework平臺上的升級版本,增強了對面向?qū)ο蟮闹С?。但由于改動太大,?dǎo)致VB.net對VB的向后兼容性不好,在業(yè)界引起不小的爭議。

大多的VB.Net程序員使用Visual Studio .Net作為IDE(integrated development environment). SharpDevelop是另一種可用的開源的IDE。VB.Net需要在.Net Framework平臺上才能執(zhí)行。 VB.NET的主頁http://msdn.microsoft.com/vbasic

用VB.NET繪制GDI圖形

  1. Protected Overrides Sub onpaint(ByVal e As System.Windows.Forms.PaintEventArgs)  
  2. '繪制任意直線  
  3. Dim g As Graphics = e.Graphics  
  4. Dim mypen As Pen = New Pen(Color.Red, 2)  
  5. g.DrawLine(mypen, 100, 100, 10, 10)  
  6. '繪制矩形(任意直線構(gòu)成的封閉圖形)  
  7. Dim point1 As PointF = New PointF(100F, 100F)  
  8. Dim point2 As PointF = New PointF(200F, 100F)  
  9. Dim point3 As PointF = New PointF(200F, 200F)  
  10. Dim point4 As PointF = New PointF(100F, 200F)  
  11. Dim curvepoints As PointF() = {point1, point2, point3, point4}  
  12. g.DrawPolygon(New Pen(Color.Blue, 2), curvepoints)  
  13. '文本表示  
  14. Dim FFamily As FontFamily = New FontFamily("Arial")  
  15. Dim font As Font = New Font(FFamily, "20", FontStyle.Bold, FontStyle.Italic,  
  16. GraphicsUnit.Pixel)  
  17. Dim text As String = "I love you!" 
  18. Dim solidbrush As SolidBrush = New SolidBrush(Color.Red)  
  19. Dim pr As PointF = New PointF(100, 10)  
  20. e.Graphics.DrawString(text, font, solidbrush, pr)  
  21. '平面繪制  
  22. Dim rec As RectangleF = New RectangleF(10, 10, 200, 100)  
  23. g.DrawPie(mypen, rec, 150, 150)  
  24. '封閉圖形,0.7應(yīng)該是個圓  
  25. g.DrawClosedCurve(mypen, curvepoints, 0.7,  
  26. Drawing.Drawing2D.FillMode.Alternate)  
  27. '大家自己試試看吧  
  28. g.DrawArc(mypen, 300, 300, 200, 200, 100, 100)  
  29. g.DrawCurve(mypen, curvepoints)  
  30. g.DrawBezier(mypen, 50, 50, 100, 50, 100, 100, 50, 100)  
  31. g.DrawBeziers(mypen, curvepoints)  
  32. '這可是一個圓  
  33. Dim rec1 As RectangleF = New RectangleF(10, 10, 100, 100)  
  34. g.DrawEllipse(mypen, rec1)  
  35. '這是一個橢圓  
  36. Dim rec2 As RectangleF = New RectangleF(10, 10, 200, 100)  
  37. g.DrawEllipse(mypen, rec2)  
  38. End Sub 

以上介紹VB.NET繪制GDI圖形,這些是我自己試驗出來的,當(dāng)然了,還有好多,我只是開了一個頭,大家要是發(fā)現(xiàn)什么好東東,別忘了通知一下。

【編輯推薦】

  1. 講解VB.NET訪問注冊表方法
  2. 淺析VB.NET開發(fā)自動分頁
  3. VB.NET ListView控件經(jīng)驗總結(jié)
  4. 概括VB.NET獲取網(wǎng)卡地址的步驟
  5. 講述VB.NET制作透明窗體
責(zé)任編輯:佚名 來源: IT168
相關(guān)推薦

2010-01-12 10:19:02

VB.NET操作GDI

2009-11-03 09:26:13

VB.NET方法

2009-11-03 10:00:20

VB.NET New方

2009-10-13 15:20:02

VB.NET使用Dra

2009-10-23 16:43:01

VB.NET繪制圖形

2010-01-13 17:16:37

VB.NET冒號

2009-10-15 17:41:14

VB.NET Impo

2009-10-27 09:31:32

VB.NET啟動Sma

2009-11-03 13:48:02

VB.NET枚舉

2009-12-24 14:30:56

VB.NET

2011-05-20 16:56:11

VB.NETGDI

2010-01-22 18:08:18

VB.NET與GDI結(jié)

2009-10-12 14:32:40

VB.NET實現(xiàn)定時關(guān)

2009-10-10 15:43:51

2009-10-16 14:07:18

VB.NET使用Mon

2009-10-13 11:28:39

VB.NET面向?qū)ο缶?/a>

2009-11-02 17:49:05

VB.NET抽象類

2009-10-28 09:47:01

VB.NET局部靜態(tài)變

2009-10-26 17:24:42

VB.NET終端服務(wù)啟

2009-10-14 10:08:05

VB.NET編寫DEC
點贊
收藏

51CTO技術(shù)棧公眾號