Converts the curve points to an array of Bezier points.
Syntax
Visual Basic (Declaration) | |
---|
Public Function ToBezierPoints() As Point() |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As RasterCurve
Dim value() As Point
value = instance.ToBezierPoints()
|
C# | |
---|
public Point[] ToBezierPoints() |
C++/CLI | |
---|
public:
array<Point>^ ToBezierPoints(); |
Return Value
An array of
Point values that contain the Bezier points.
Example
This sample draws a smooth closed curve on a graphics that goes through five points.
Visual Basic | Copy Code |
---|
Public Sub ToBezierPointsExample()
Dim curve As RasterCurve = New RasterCurve()
curve.Points.Add(New Point(130, 130))
curve.Points.Add(New Point(130, 300))
curve.Points.Add(New Point(230, 230))
curve.Points.Add(New Point(175, 175))
curve.Points.Add(New Point(230, 130))
curve.Type = RasterCurveType.Standard
curve.FillMode = FillMode.Winding
curve.Tension = 0.5
curve.Close = RasterCurveClose.Close
Dim bezierPoints As Point() = curve.ToBezierPoints()
Dim btmp As Bitmap = New Bitmap(400, 400)
Dim g As Graphics = Graphics.FromImage(btmp)
g.FillRectangle(Brushes.White, New Rectangle(0, 0, 400, 400))
g.DrawBeziers(Pens.Black, bezierPoints)
g.Dispose()
Dim fileName As String = LeadtoolsExamples.Common.ImagesPath.Path + "ToBezierPoints.bmp"
btmp.Save(fileName, ImageFormat.Bmp)
btmp.Dispose()
End Sub |
C# | Copy Code |
---|
public void ToBezierPointsExample() { // Define the curve RasterCurve curve = new RasterCurve(); curve.Points.Add(new Point(130, 130)); curve.Points.Add(new Point(130, 300)); curve.Points.Add(new Point(230, 230)); curve.Points.Add(new Point(175, 175)); curve.Points.Add(new Point(230, 130)); curve.Type = RasterCurveType.Standard; curve.FillMode = FillMode.Winding; curve.Tension = 0.5; curve.Close = RasterCurveClose.Close; // convert this curve into bezier points Point[] bezierPoints = curve.ToBezierPoints(); // Draw this curve on a bitmap Bitmap btmp = new Bitmap(400, 400); Graphics g = Graphics.FromImage(btmp); g.FillRectangle(Brushes.White, new Rectangle(0, 0, 400, 400)); g.DrawBeziers(Pens.Black, bezierPoints); g.Dispose(); // save this image to disk string fileName = LeadtoolsExamples.Common.ImagesPath.Path + "ToBezierPoints.bmp"; btmp.Save(fileName, ImageFormat.Bmp); btmp.Dispose(); } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also