Sign in to follow this  
Guest bartels

Bezier

Recommended Posts

Gentlemen -I am trying to draw a curve with GDI+, and try as I might I cannot get the curve to look right with the built in GDI+ functions that deal with curves, pies, and arcs. So I have come to the conclusion that bezier curves are the way to go. After much reading, I know that I need endpoints(which I have), and two control points. Here is my problem. I want to calculate exactly where these control points need to be, but I don't know how. Google isn't helping me much, so can any of you gentlemen point me in the right direction?Much appreciated!

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Can't help you much hear, I seldom use splines in GDI+. The only time was using GraphicPath::AddClosedCurve() to simulate the curvarture of a non-flat display. It was a lot of try and error, and I ended with using a rectangle with rounded edges (GraphicsPath::AddArc();,GraphicsPath::AddArc();,...GraphicsPath::CloseFigure();) that was easier and much more predictable.It depends for what you need it.Arne Bartels

Share this post


Link to post
Share on other sites

You said Bezier, AddClosedCurve uses cardinal splines, sorry for confusing. I assume one way to get the two control points is to try it out with another draw program e.g. Corel Draw and jot down the coordinates and then use these. If I recall that right there was a discussion about Bezier splines some time ago on this forum, just around the time the dscussion about GDI+ came out. Including calculating control points, but I not sure.Arne Bartels

Share this post


Link to post
Share on other sites

Arne,Thank you for your posts. I think the best idea is to do as you said, use Corel draw and just copy the points down. I did a search for the discussion you referenced, but came up dry. Thanks!

Share this post


Link to post
Share on other sites

I thought about this topic: #10279, but it doesn't contain formulae. I happen to be quite good in math (4 semesters, some time ago), I could dig for calculations of Bezier, but I think the viaual way I proposed is better to use.Arne Bartels

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this