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

迅速掌握VB.NET操作GDI圖形

開(kāi)發(fā) 后端
VB.NET操作GDI圖形的操作方法有很多種,運(yùn)用VB.NET對(duì)這一類型的圖像進(jìn)行操作,可以幫助開(kāi)發(fā)人員輕松的完成各種功能需求。

VB.NET編程語(yǔ)言在對(duì)圖形的操作上可以體現(xiàn)出其全面和靈活性。我們可以通過(guò)VB.NET操作GDI圖形的相關(guān)操作方法和實(shí)現(xiàn)的功能來(lái)對(duì)這一方面的知識(shí)進(jìn)行一個(gè)系統(tǒng)的認(rèn)識(shí),了解VB.NET在操作中的簡(jiǎn)便靈活性。#t#

下面的例子通過(guò)重載Form1窗體的OnPaint()方法繪制GDI圖形

  1. Protected Overrides Sub onpaint
    (ByVal e As System.Windows.
    Forms.PaintEventArgs) 

注釋://///////////VB.NET操作GDI圖形繪制任意直線

  1. Dim g As Graphics = 
    e.Graphics  
  2. Dim mypen As Pen = 
    New Pen(Color.Red, 2)  
  3. g.DrawLine(mypen, 
    100, 100, 10, 10) 

注釋://///////////繪制矩形(任意直線構(gòu)成的封閉圖形)

  1. Dim point1 As PointF = 
    New PointF(100F, 100F)  
  2. Dim point2 As PointF = 
    New PointF(200F, 100F)  
  3. Dim point3 As PointF = 
    New PointF(200F, 200F)  
  4. Dim point4 As PointF = 
    New PointF(100F, 200F)  
  5. Dim curvepoints As PointF() 
    = {point1, point2,
     point3, point4}  
  6. g.DrawPolygon(New 
    Pen(Color.Blue, 2), 
    curvepoints) 

注釋:////////////VB.NET操作GDI圖形文本表示

  1. Dim FFamily As FontFamily = 
    New FontFamily("Arial")  
  2. Dim font As Font = New Font
    (FFamily, "20", FontStyle.
    Bold, FontStyle.Italic, 
    GraphicsUnit.Pixel)  
  3. Dim text As String =
     
    "I love you!" 
  4. Dim solidbrush As SolidBrush 
    New SolidBrush(Color.Red)  
  5. Dim pr As PointF = 
    New PointF(100, 10)  
  6. e.Graphics.DrawString
    (text, font, solidbrush, pr) 

注釋:////////////VB.NET操作GDI圖形平面繪制

  1. Dim rec As RectangleF = 
    New RectangleF(10, 10, 
    200, 100)  
  2. g.DrawPie(mypen, rec, 
    150, 150) 

注釋:///////////封閉圖形,0.7應(yīng)該是個(gè)圓

  1. g.DrawClosedCurve(mypen, 
    curvepoints, 0.7, Drawing.
    Drawing2D.FillMode.Alternate) 

注釋:///////////大家自己試試看吧

  1. g.DrawArc(mypen, 300, 300, 
    200, 200, 100, 100)  
  2. g.DrawCurve(mypen, curvepoints)  
  3. g.DrawBezier(mypen, 50, 50, 
    100, 50, 100, 100, 50, 100)  
  4. g.DrawBeziers(mypen, curvepoints) 

注釋://////////這可是一個(gè)圓

  1. Dim rec1 As RectangleF = 
    New RectangleF(10, 10, 100, 100)  
  2. g.DrawEllipse(mypen, rec1) 

注釋://////////這是一個(gè)橢圓

  1. Dim rec2 As RectangleF = 
    New RectangleF(10, 10, 200, 100)  
  2. g.DrawEllipse(mypen, rec2)  
  3. End Sub  

VB.NET操作GDI圖形的各種操作技巧就為大家介紹到這里。

責(zé)任編輯:曹凱 來(lái)源: 博客園
相關(guān)推薦

2010-01-11 14:28:14

VB.NET操作Exc

2009-10-29 13:38:05

VB.NET Shar

2010-01-07 11:07:20

VB.NET讀取INI

2009-10-16 10:36:35

VB.NET繪制GDI

2009-10-30 16:40:04

VB.NET Inte

2010-01-11 10:34:41

VB.NET圖像操作

2010-01-08 18:10:44

VB.NET實(shí)現(xiàn)任務(wù)欄

2010-01-11 15:54:48

VB.NET操作縮放圖

2009-10-29 09:06:26

VB.NET Web

2010-01-22 18:08:18

VB.NET與GDI結(jié)

2011-05-20 16:56:11

VB.NETGDI

2009-10-29 14:16:32

VB.NET讀寫(xiě)文本文

2010-01-08 18:16:52

VB.NET變量

2010-01-14 13:59:01

2010-01-13 17:47:59

VB.NET拖放

2010-01-18 19:36:52

VB.NET調(diào)整控件

2009-11-10 13:43:28

VB.NET Comm

2010-01-14 10:07:08

VB.NET文件名排序

2009-10-21 10:05:48

VB.NET Read

2009-10-27 14:50:25

VB.NET控件數(shù)組
點(diǎn)贊
收藏

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