0

Does GDI+ (System.Drawing.Graphics in .NET) offer some method to determine points on a graphics path?

Specifically, I'm hoping to find an easy way to write the following function:

 Point positionAt(GraphicsPath path, Single where)

with where a number between 0 and 1 specifying how far to travel along the path.

reinierpost
  • 8,425
  • 1
  • 38
  • 70

1 Answers1

2

Try the GraphicsPath.GetPathData method:

http://msdn.microsoft.com/en-us/library/ms535534(v=vs.85).aspx

Pedery
  • 3,632
  • 1
  • 27
  • 39
  • Thank you, I didn't know this method and it looks useful. I would still have to write my logic to get the answer, which is no fun for Bezier curves. – reinierpost Jul 01 '11 at 08:15
  • In that case, write your own Bezier curves! It's not hard *at all*. And you'll get your [0, 1] range right there as a concequence of the implementation. – Pedery Jul 02 '11 at 11:09