Bezier is very difficult to programmly control the line path.
A Bezier curve is a type of spline.
I want the line going through all the control points so that it would be easy to programmly layout curved links.
In the current GoDiagram, if I want a curved link with specified layout or path, I need to call the SetPoint method. But SetPoint seems to set the control points on a Bezier link, which are not the points on the link.Could you provide a picture of an example of the points you want to specify programmatically and what curve you would want as a result?
We used another drawing library before but not we are using GoDiagram. We have a lot of data files created by this old drawing library, in which the line path is described by points going through the line.
That depends on what kind of curve your old library generated for those points. There are lots of possibilities.
OK, I should rephrase my question. Please forget previous posters.
If GoLink’s Style is Bezier, user can drag one of the two points (in the middle of the link) to change the link’s path. But the link’s path does not go through these two points.
My question is what should I do to make the link’s path go through these two points. I know there are a lot of possibilities, but I just want one of them, which is a smooth path.
Is the quadratic Bezier what I want? If so, which methods should I override in GoLink to implement quadratic Bezier?
There are lots of different ways for a curve to go through a set of points. That’s why I’m asking what kind of curve you wanted.
Sorry for my limited knowledge of geometry. I want a visually smooth line passing through the four points, which are used in the current Bezier GoLink.
Yes, there are many possibilities, but I just want one of them.
I just want the one if you think it’s the easiest to implement.
Is it possible to do it by overriding some of the GoLink methods?
I just noticed in .NET Graphics class, there is DrawBezier method as well as DrawCurve method, the latter one is the one I want. The problem becomes if I use DrawCurve method to draw link’s path, could you give me some ideas how to implement link selection using mouse and how to respond the user drag on one of the control points?
OK, I did the minimum work to implement such a stroke class:
Thank you very much indeed. I will try to make it work in my program. Hope this feature be added in later GoDiagram.