Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Drawing Bézier splines

Total Hit ( 3563)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


GDI+ supports two different forms of a complex curve that can't be represented as an arc of a circle or an ellipse: a cardinal spline and a Bézier spline. A Bézier spline is a curve specified by four points: the initial point, the ending point, and two control points. The curve doesn't pass through the controls points, but they influence the direction of the curve at the starting and ending points. More precisely, the Bézier spline begins in the direction indicated by the imaginary line that joins the starting point and the first control point and ends in the direction indicated by the imaginary line that joins the second control point and the ending line. You can draw this kind of curve by using the DrawBezier method, which takes four Point objects (in this order): the starting point, the first control point, the second control point, and the ending point. For example, here's the code that draws a Bézier curve:

Click here to copy the following block
' This statement assumes that you have imported the System.Drawing namespace

' This code should run inside a Windows Form class
Dim gr As Graphics = Me.CreateGraphics
gr.DrawBezier(Pens.Black, New Point(10, 30), New Point(100, 20), New Point(140, _
  190), New Point(200, 200))
gr.Dispose

You can also draw multiple connected Bézier curves with the DrawBeziers method. This method takes an array of Point objects. The first four objects define the first curve, and then each subsequent group of three objects define the control points and the ending point for the next curve.


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.