December 28, 200322 yr 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!
December 28, 200322 yr 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
December 28, 200322 yr 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
December 29, 200322 yr 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!
December 29, 200322 yr 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
Create an account or sign in to comment