本文整理匯總了VB.NET中System.Drawing.Graphics.FillClosedCurve方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Graphics.FillClosedCurve方法的具體用法?VB.NET Graphics.FillClosedCurve怎麽用?VB.NET Graphics.FillClosedCurve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.FillClosedCurve方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: FillClosedCurvePoint
Public Sub FillClosedCurvePoint(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
'Create array of points for curve.
Dim point1 As New Point(100, 100)
Dim point2 As New Point(200, 50)
Dim point3 As New Point(250, 200)
Dim point4 As New Point(50, 150)
Dim points As Point() = {point1, point2, point3, point4}
' Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points)
End Sub
示例2: FillClosedCurvePointF
Public Sub FillClosedCurvePointF(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
'Create array of points for curve.
Dim point1 As New PointF(100.0F, 100.0F)
Dim point2 As New PointF(200.0F, 50.0F)
Dim point3 As New PointF(250.0F, 200.0F)
Dim point4 As New PointF(50.0F, 150.0F)
Dim points As PointF() = {point1, point2, point3, point4}
' Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points)
End Sub
示例3: FillClosedCurvePointFillMode
Public Sub FillClosedCurvePointFillMode(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
'Create array of points for curve.
Dim point1 As New Point(100, 100)
Dim point2 As New Point(200, 50)
Dim point3 As New Point(250, 200)
Dim point4 As New Point(50, 150)
Dim points As Point() = {point1, point2, point3, point4}
' Set fill mode.
Dim newFillMode As FillMode = FillMode.Winding
' Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points, newFillMode)
End Sub
示例4: FillClosedCurvePointFFillMode
Public Sub FillClosedCurvePointFFillMode(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create array of points for curve.
Dim point1 As New PointF(100.0F, 100.0F)
Dim point2 As New PointF(200.0F, 50.0F)
Dim point3 As New PointF(250.0F, 200.0F)
Dim point4 As New PointF(50.0F, 150.0F)
Dim points As PointF() = {point1, point2, point3, point4}
' Set fill mode.
Dim newFillMode As FillMode = FillMode.Winding
' Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points, newFillMode)
End Sub
示例5: FillClosedCurvePointFillModeTension
Public Sub FillClosedCurvePointFillModeTension(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create array of points for curve.
Dim point1 As New Point(100, 100)
Dim point2 As New Point(200, 50)
Dim point3 As New Point(250, 200)
Dim point4 As New Point(50, 150)
Dim points As Point() = {point1, point2, point3, point4}
' Set fill mode.
Dim newFillMode As FillMode = FillMode.Winding
' Set tension.
Dim tension As Single = 1.0F
' Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension)
End Sub
示例6: FillClosedCurvePointFFillModeTension
Public Sub FillClosedCurvePointFFillModeTension(ByVal e As PaintEventArgs)
' Create solid brush.
Dim redBrush As New SolidBrush(Color.Red)
' Create array of points for curve.
Dim point1 As New PointF(100.0F, 100.0F)
Dim point2 As New PointF(200.0F, 50.0F)
Dim point3 As New PointF(250.0F, 200.0F)
Dim point4 As New PointF(50.0F, 150.0F)
Dim points As PointF() = {point1, point2, point3, point4}
' Set fill mode.
Dim newFillMode As FillMode = FillMode.Winding
' Set tension.
Dim tension As Single = 1.0F
' Fill curve on screen.
e.Graphics.FillClosedCurve(redBrush, points, newFillMode, tension)
End Sub
示例7: FillClosedCurve
' 導入命名空間
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
public class FillClosedCurve
public Shared Sub Main
Application.Run(New FillModesForm)
End Sub
End class
Public Class FillModesForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
Me.Text = "FillModesForm"
End Sub
#End Region
Private Sub FillModesForm_Paint(ByVal sender As Object, ByVal e As PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim x As Integer = 0
Dim y As Integer = 0
Dim width As Integer = Me.ClientRectangle.Width / 2
Dim height As Integer = Me.ClientRectangle.Height
Dim fillBrush As Brush = Brushes.Gray
Dim pen As Pen = New Pen(Color.Red, 4)
Dim pointPen As Pen = New Pen(Color.Black, 3)
pointPen.StartCap = pointPen.EndCap = LineCap.SquareAnchor
Dim points As PointF() = New PointF() {New PointF(x + 25, y + height - 25), New PointF(x + width - 25, y + height - 25), New PointF(x + 25, height / 2), New PointF(x + width - 25, y + 25), New PointF(x + 25, y + 25), New PointF(x + width - 25, height / 2)}
g.DrawClosedCurve(pen, points)
Dim fill As FillMode = FillMode.Winding
g.FillClosedCurve(fillBrush, points, fill)
End Sub
End Class