本文整理汇总了VB.NET中System.Drawing.Graphics.DrawClosedCurve方法的典型用法代码示例。如果您正苦于以下问题:VB.NET Graphics.DrawClosedCurve方法的具体用法?VB.NET Graphics.DrawClosedCurve怎么用?VB.NET Graphics.DrawClosedCurve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.DrawClosedCurve方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: DrawClosedCurvePointTension
Private Sub DrawClosedCurvePointTension(ByVal e As PaintEventArgs)
' Create pens.
Dim redPen As New Pen(Color.Red, 3)
Dim greenPen As New Pen(Color.Green, 3)
' Create points that define curve.
Dim point1 As New Point(50, 50)
Dim point2 As New Point(100, 25)
Dim point3 As New Point(200, 5)
Dim point4 As New Point(250, 50)
Dim point5 As New Point(300, 100)
Dim point6 As New Point(350, 200)
Dim point7 As New Point(250, 250)
Dim curvePoints As Point() = {point1, point2, point3, point4, _
point5, point6, point7}
' Draw lines between original points to screen.
e.Graphics.DrawLines(redPen, curvePoints)
' Create tension and fill mode.
Dim tension As Single = 1.0F
Dim aFillMode As FillMode = FillMode.Alternate
' Draw closed curve to screen.
e.Graphics.DrawClosedCurve(greenPen, curvePoints, tension, _
aFillMode)
End Sub
示例2: DrawClosedCurvePointFTension
Private Sub DrawClosedCurvePointFTension(ByVal e As PaintEventArgs)
' Create pens.
Dim redPen As New Pen(Color.Red, 3)
Dim greenPen As New Pen(Color.Green, 3)
' Create points that define curve.
Dim point1 As New PointF(50.0F, 50.0F)
Dim point2 As New PointF(100.0F, 25.0F)
Dim point3 As New PointF(200.0F, 5.0F)
Dim point4 As New PointF(250.0F, 50.0F)
Dim point5 As New PointF(300.0F, 100.0F)
Dim point6 As New PointF(350.0F, 200.0F)
Dim point7 As New PointF(250.0F, 250.0F)
Dim curvePoints As PointF() = {point1, point2, point3, point4, _
point5, point6, point7}
' Draw lines between original points to screen.
e.Graphics.DrawLines(redPen, curvePoints)
' Create tension and fill mode.
Dim tension As Single = 1.0F
Dim aFillMode As FillMode = FillMode.Alternate
' Draw closed curve to screen.
e.Graphics.DrawClosedCurve(greenPen, curvePoints, tension, _
aFillMode)
End Sub
示例3: DrawClosedCurvePoint
Private Sub DrawClosedCurvePoint(ByVal e As PaintEventArgs)
' Create pens.
Dim redPen As New Pen(Color.Red, 3)
Dim greenPen As New Pen(Color.Green, 3)
' Create points that define curve.
Dim point1 As New Point(50, 50)
Dim point2 As New Point(100, 25)
Dim point3 As New Point(200, 5)
Dim point4 As New Point(250, 50)
Dim point5 As New Point(300, 100)
Dim point6 As New Point(350, 200)
Dim point7 As New Point(250, 250)
Dim curvePoints As Point() = {point1, point2, point3, point4, _
point5, point6, point7}
' Draw lines between original points to screen.
e.Graphics.DrawLines(redPen, curvePoints)
' Draw closed curve to screen.
e.Graphics.DrawClosedCurve(greenPen, curvePoints)
End Sub
示例4: DrawClosedCurvePointF
Private Sub DrawClosedCurvePointF(ByVal e As PaintEventArgs)
' Create pens.
Dim redPen As New Pen(Color.Red, 3)
Dim greenPen As New Pen(Color.Green, 3)
' Create points that define curve.
Dim point1 As New PointF(50.0F, 50.0F)
Dim point2 As New PointF(100.0F, 25.0F)
Dim point3 As New PointF(200.0F, 5.0F)
Dim point4 As New PointF(250.0F, 50.0F)
Dim point5 As New PointF(300.0F, 100.0F)
Dim point6 As New PointF(350.0F, 200.0F)
Dim point7 As New PointF(250.0F, 250.0F)
Dim curvePoints As PointF() = {point1, point2, point3, point4, _
point5, point6, point7}
' Draw lines between original points to screen.
e.Graphics.DrawLines(redPen, curvePoints)
' Draw closed curve to screen.
e.Graphics.DrawClosedCurve(greenPen, curvePoints)
End Sub
示例5: DrawClosedCurve
' 导入命名空间
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
public class DrawClosedCurve
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)
End Sub
End Class