I am rendering an interpolation curve thusly:
e.Graphics.DrawLines(new Pen(Color.Red), _interpolationPoints.ToArray());
which sometimes throws an OverflowException.
Examination of the _interpolationPoints array shows some very large values in scientific notation e.g. {X = 0.0 Y = -1.985174E+10}
I suspect that Y = -1.985174E+10 is a value that GDI+ cannot handle. That's fine but what are the max/min X and Y values into which I can draw and so constrain the data (and warn the user) rather than catching the overflow exception during paint? Are the limits documented?
For example, I would like to do something like this:
if (yVal < float.MinValue || yval > float.MaxValue)
throw new OverflowException("Interpolation value too large to be rendered.");
during the population of the _interpolationPoints array and stop the process. (float mix/max does not work btw. i still get the exception.)