I am recieving random exceptions when drawing a GoRoundedRectangle object. This can occur on the first object drawn, but not always. Sometimes I can draw several before the exception is generated.
Walter: Have you seen this? Here is the stack trace.
Thanks,
Erik
OnPaint: System.ArgumentException: Invalid parameter used.
at System.Drawing.Drawing2D.GraphicsPath.AddArc(Single x, Single y, Single width, Single height, Single startAngle, Single sweepAngle)
at Northwoods.Go.GoRoundedRectangle.GetPath(Single offx, Single offy)
at Northwoods.Go.GoRoundedRectangle.Paint(Graphics g, GoView view)
at Northwoods.Go.GoLayer.Paint(Graphics g, GoView view, RectangleF clipRect)
at Northwoods.Go.GoView.PaintObjects(Boolean doc, Boolean view, Graphics g, RectangleF clipRect)
at Northwoods.Go.GoView.PaintView(Graphics g, RectangleF clipRect)
at Northwoods.Go.GoView.onPaintCanvas(PaintEventArgs evt)
at Northwoods.Go.GoView.OnPaint(PaintEventArgs evt)
No, I have never seen such an error. What version is that?
Typically that “Invalid parameter used” error comes from trying to use a Disposed GraphicsPath. I don’t see how that could happen, unless perhaps you are making changes in another thread. You should be making changes in the GoView’s thread, normally by calling Invoke on the view. If this is the problem, then maybe we should try to make GoDiagram more thread-safe, which currently it is not claimed to be.