Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Animate a shape along a Bezier link (Read 1544 times)
rdwheeler
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 15
Joined: May 28th, 2008
Animate a shape along a Bezier link
May 24th, 2022 at 4:03pm
Print Post  
We would love to have a reliable way to animate a shape (perhaps an SVG shape if possible) from the start of a link to the end, in order to suggest the flow of data to our users. Is there a way to do that?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: Animate a shape along a Bezier link
Reply #1 - May 25th, 2022 at 8:50am
Print Post  
You can find some ways to trace flow shown in Demo/Graphs/PathFinding and in CustomDraw examples. If you prefer moving a node along the path, you could call InternalUtils.PointAlongLength to find position for the node, where distance argument is between 0 and DiagramLink.Length. For second 'segments' argument, try using result of this function when the link is Bezier -

Code
Select All
PointF[] ConvertToPolyline(DiagramLink link)
{
	using (var path = new GraphicsPath())
	{
		float maxDist = 0.75f * Constants.GetMillimeter(link.MeasureUnit);
		path.AddBeziers(link.Points.GetArray());
		path.Flatten(Constants.IdentityMatrix, maxDist);
		return path.PathPoints;
	}
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint