InertiaM
Well-known member
I'm getting an Overflow Exception when drawing multiple ellipses. It's failing on the DrawEllipse method, but the values I'm passing it seem to be acceptable.
On debugging, it shows :-
The InnerException shows :-
It only happens very occasionally, and I can reproduce it.
Any suggestions?
VB.NET:
Private p As Pen = New System.Drawing.Pen(Color.Black, 1)
Private r As System.Drawing.RectangleF
Private Sub DrawBlock(ByRef e As System.Windows.Forms.PaintEventArgs, ByVal x As Single, ByVal y As Single)
.....
e.Graphics.DrawEllipse(p, r)
.....
End Sub
On debugging, it shows :-
VB.NET:
r {X = -4.0 Y = -4.0 Width = 8.0 Height = 8.0}
The InnerException shows :-
VB.NET:
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawEllipse(Pen pen, Single x, Single y, Single width, Single height)
at System.Drawing.Graphics.DrawEllipse(Pen pen, RectangleF rect)
It only happens very occasionally, and I can reproduce it.
Any suggestions?