Attached is a diff for Graphics.cs that fixes the problem. Someone please approve.
Cheers Alexander Olk Am Freitag, den 17.02.2006, 23:15 +0100 schrieb Pascal Fresnay: > Hi, > I attached a simple GDI+ apps that works well on .NET, but failed with > mono, both on Windows and Linux (with mono 1.1.13) with this error : > > Mono System.Windows.Forms Assembly [Revision: 54007; built: 2005/12/6 > 14:35:24] > Keyboard: French keyboard layout > Gtk not found (missing LD_LIBRARY_PATH to libgtk-x11-2.0.so?), using > built-in colorscheme > > Unhandled Exception: System.IndexOutOfRangeException: Array index is out > of range. > in <0x0008d> System.Drawing.Graphics:DrawBeziers (System.Drawing.Pen > pen, System.Drawing.Point[] points) > in (wrapper remoting-invoke-with-check) > System.Drawing.Graphics:DrawBeziers > (System.Drawing.Pen,System.Drawing.Point[]) > in <0x002f2> Exemple6d.Form1:OnPaint > (System.Windows.Forms.PaintEventArgs e) > in <0x00498> System.Windows.Forms.Control:WndProc > (System.Windows.Forms.Message m) > in <0x0000d> System.Windows.Forms.ScrollableControl:WndProc > (System.Windows.Forms.Message m) > in <0x0000d> System.Windows.Forms.ContainerControl:WndProc > (System.Windows.Forms.Message m) > in <0x008dc> System.Windows.Forms.Form:WndProc > (System.Windows.Forms.Message m) > in <0x00014> System.Windows.Forms.Control+ControlNativeWindow:WndProc > (System.Windows.Forms.Message m) > in <0x0011e> System.Windows.Forms.NativeWindow:WndProc (IntPtr hWnd, Msg > msg, IntPtr wParam, IntPtr lParam) > in <0x00016> System.Windows.Forms.XplatUIX11:DispatchMessage > (System.Windows.Forms.MSG msg) > in <0x00015> System.Windows.Forms.XplatUI:DispatchMessage > (System.Windows.Forms.MSG msg) > in <0x0061d> System.Windows.Forms.Application:RunLoop (Boolean Modal, > System.Windows.Forms.ApplicationContext context) > in <0x00024> System.Windows.Forms.Application:Run > (System.Windows.Forms.Form mainForm) > in <0x0001f> Exemple6d.Form1:Main () > _______________________________________________ > Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com > http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Index: Graphics.cs =================================================================== --- Graphics.cs (revision 57028) +++ Graphics.cs (working copy) @@ -341,10 +341,10 @@ int length = points.Length; Status status; - if (length < 3) + if (length < 4) return; - for (int i = 0; i < length; i += 3) { + for (int i = 0; i < length - 1; i += 3) { Point p1 = points [i]; Point p2 = points [i + 1]; Point p3 = points [i + 2]; @@ -368,10 +368,10 @@ int length = points.Length; Status status; - if (length < 3) + if (length < 4) return; - for (int i = 0; i < length; i += 3) { + for (int i = 0; i < length - 1; i += 3) { PointF p1 = points [i]; PointF p2 = points [i + 1]; PointF p3 = points [i + 2];
_______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list