2

I was wondering if there is any way to check the validity of an object of PathGeometry.

I need to use GetPointAtFractionLength to get some point at the path, however for some paths this function throws an exception:

Value does not fall within the expected range.

Jean
  • 7,623
  • 6
  • 43
  • 58
commando
  • 235
  • 1
  • 3
  • 6
  • I'm not sure why you would need to check if the pathGeometry is valid, as you're looking for a point on that path based on it's length. Unless you're passing a "progress" that is outside of the range of the path I'm lost. Just remember that if the "progress" is larger than 100% you'll have problems. – Chris Nicol Oct 10 '11 at 19:06
  • Can you clarify your issue a bit more? Perhaps an example. – Chris Nicol Oct 10 '11 at 19:06
  • I'm getting this occasionally from remote exception logging so I don't have a repro at present. I'm passing 0.5 as the fraction, so the problem must be the path. I know this question is 4 years old but it's the only hit I got on google for this problem so I thought I should pitch in. – Jon Jan 08 '15 at 09:45
  • 2
    Update: Geometries with zero-length paths will throw this exception if GetPointAtFractionLength() is called on them. – Jon Jan 08 '15 at 11:53

0 Answers0