[Mono-bugs] [Bug 75326][Wis] New - Graphics.Clear() throws exception

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jun 20 12:06:12 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by davide.morelli at parser.it.

http://bugzilla.ximian.com/show_bug.cgi?id=75326

--- shadow/75326	2005-06-20 12:06:12.000000000 -0400
+++ shadow/75326.tmp.16830	2005-06-20 12:06:12.000000000 -0400
@@ -0,0 +1,230 @@
+Bug#: 75326
+Product: Mono: Class Libraries
+Version: 1.1
+OS: Mac OS X 10.3
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Drawing.
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: davide.morelli at parser.it               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Graphics.Clear() throws exception
+
+This bug is related to 75063
+
+Description of Problem:
+Graphics.Clear() throws exception
+
+
+Steps to reproduce the problem:
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+
+namespace TestSWF1
+{
+	/// <summary>
+	/// Descrizione di riepilogo per Form1.
+	/// </summary>
+	public class Form1 : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel area_diesgno;
+		private System.Windows.Forms.Button button1;
+		GraphicsPath gp = new GraphicsPath();
+		private System.Windows.Forms.Panel tappalo;
+		/// <summary>
+		/// Variabile di progettazione necessaria.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public Form1()
+		{
+			//
+			// Necessario per il supporto di Progettazione 
+Windows Form
+			//
+			InitializeComponent();
+tappalo.Visible = false;
+			//
+			// TODO: aggiungere il codice del costruttore 
+dopo la chiamata a InitializeComponent
+			//
+		}
+
+		/// <summary>
+		/// Pulire le risorse in uso.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if (components != null) 
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Codice generato da Progettazione Windows Form
+		/// <summary>
+		/// Metodo necessario per il supporto della finestra di 
+progettazione. Non modificare
+		/// il contenuto del metodo con l'editor di codice.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.area_diesgno = new System.Windows.Forms.Panel
+();
+			this.button1 = new System.Windows.Forms.Button();
+			this.tappalo = new System.Windows.Forms.Panel();
+			this.SuspendLayout();
+			// 
+			// area_diesgno
+			// 
+			this.area_diesgno.BackColor = 
+System.Drawing.Color.White;
+			this.area_diesgno.BorderStyle = 
+System.Windows.Forms.BorderStyle.FixedSingle;
+			this.area_diesgno.Location = new 
+System.Drawing.Point(24, 48);
+			this.area_diesgno.Name = "area_diesgno";
+			this.area_diesgno.Size = new System.Drawing.Size
+(360, 272);
+			this.area_diesgno.TabIndex = 0;
+			this.area_diesgno.Paint += new 
+System.Windows.Forms.PaintEventHandler(this.area_diesgno_Paint);
+			this.area_diesgno.MouseMove += new 
+System.Windows.Forms.MouseEventHandler(this.area_diesgno_MouseMove);
+			// 
+			// button1
+			// 
+			this.button1.Location = new System.Drawing.Point
+(312, 16);
+			this.button1.Name = "button1";
+			this.button1.TabIndex = 1;
+			this.button1.Text = "button1";
+			// 
+			// tappalo
+			// 
+			this.tappalo.Location = new System.Drawing.Point
+(16, 24);
+			this.tappalo.Name = "tappalo";
+			this.tappalo.Size = new System.Drawing.Size(312, 
+232);
+			this.tappalo.TabIndex = 2;
+			// 
+			// Form1
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size
+(5, 13);
+			this.ClientSize = new System.Drawing.Size(416, 
+350);
+			this.Controls.Add(this.tappalo);
+			this.Controls.Add(this.button1);
+			this.Controls.Add(this.area_diesgno);
+			this.Name = "Form1";
+			this.Text = "Form1";
+			this.MouseMove += new 
+System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		/// <summary>
+		/// Il punto di ingresso principale dell'applicazione.
+		/// </summary>
+		[STAThread]
+		static void Main() 
+		{
+			Application.Run(new Form1());
+		}
+
+		private Matrix matrice = new Matrix();
+		private void area_diesgno_Paint(object sender, 
+System.Windows.Forms.PaintEventArgs e)
+		{
+			try
+			{
+				e.Graphics.Clear(Color.White);
+				e.Graphics.DrawLine(new Pen(Color.Black), 
+0,0,100,100);
+				GraphicsPath gp = new GraphicsPath();
+				//gp.AddLine(400,0,200,200);
+				PointF []punti = new PointF[3];
+				punti[0] = new PointF(0,0);
+				punti[1] = new PointF(100,150);
+				punti[2] = new PointF(200,200);
+				//			punti[3] = new 
+PointF(200,0);
+				//			punti[4] = new 
+PointF(100,100);
+				gp.AddCurve(punti);
+				gp.Transform(matrice);
+				e.Graphics.DrawPath(new Pen(Color.Blue), 
+gp);
+			} 
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.ToString());
+			}
+		}
+
+		private void Form1_MouseMove(object sender, 
+System.Windows.Forms.MouseEventArgs e)
+		{
+
+		}
+
+		private void area_diesgno_MouseMove(object sender, 
+System.Windows.Forms.MouseEventArgs e)
+		{
+			//MessageBox.Show("mousemove");
+			matrice = new Matrix();
+			matrice.Translate(e.X, e.Y);
+			//this.Refresh();
+			area_diesgno.Refresh();//	Refresh();
+		//	tappalo.Visible = true;
+		//	tappalo.Visible = false;
+
+		}
+	}
+}
+
+
+
+Actual Results: 
+
+
+System.ArgumentException: Invalid Parameter. A null reference or invalid 
+value was found.
+in <0x000BB> System.Drawin.GDIPlus:CheckStatus (Status status)
+in <0x00060> System.Drawin.Graphics:Clear(color color)
+in (wrapper remoting-invoke-with-check) 
+System.Drawin.Graphics:clear(System.Drawing.Color)
+
+
+Expected Results:
+panel refreshed
+
+How often does this happen? 
+always
+
+Additional Information:
+I am using mono 1.1.7
+os: 10.3
+hw: MacMini
+
+same exception with Graphics.DrawImage(Image, PointF[])


More information about the mono-bugs mailing list