Monday, October 18, 2010

GDI Graphics Rendering with VB.NET



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)

Note :///////////// draw the rectangle (any linear form of the closed graph)

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)

Note ://////////// text that

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)

Note ://////////// plane drawing

Dim rec As RectangleF = New RectangleF (10, 10, 200, 100)

g.DrawPie (mypen, rec, 150, 150)

Note ://///////// closed graph, should be a circle of 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)

Note :////////// That's a circle

Dim rec1 As RectangleF = New RectangleF (10, 10, 100, 100)

g.DrawEllipse (mypen, rec1)

Note :////////// This is an ellipse

Dim rec2 As RectangleF = New RectangleF (10, 10, 200, 100)

g.DrawEllipse (mypen, rec2)

End Sub







相关链接:



J2ME Game NORMAL-FRAME



FLV to 3GP



Storage Timers And Time Synch



Taught you how to DB2 patch



Computer Sounded The Same Side, "Chong Fenghao"



"The new Two Most Honorable Knights Prequel" Land of Artifact extension detailed Raiders



Trace And Ping Tools Comments



Wlanapi Dll Not Found Error Repair It Yourself



Intel Claims AMD Is Due To Be Executive Pay



evaluation Desktop



The implementation of EU environmental directives will rob the U.S. Green Certification in China



3GP to MOV



"Unbeatable team" Five Steps



MP4 To 3GP



Exposed part of the interface, CF interface only 16mmSD Reader



2 comments:

  1. Wonderful blog! I fοund it while searching on Yahoo News.

    Do you haνe any tiрs on hoω to get listeԁ in Yahоо News?
    I've been trying for a while but I never seem to get there! Thank you

    My web site; https://www.youtube.com/watch?v=4Qozd6jyuVw

    ReplyDelete
  2. great publish, very informative. I'm wondering why the other experts of this sector don't notice this.
    You should proceed your writing. I'm sure, you've a great readers' base already!

    Here is my site; https://www.youtube.com/watch?v=4Qozd6jyuVw

    ReplyDelete