[Mono-bugs] [Bug 60290][Nor] New - Promlems with x-axis on Bitmaps

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 16 Jun 2004 11:11:34 -0400 (EDT)


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 juergen.moeller@elektrobude.de.

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

--- shadow/60290	2004-06-16 11:11:34.000000000 -0400
+++ shadow/60290.tmp.4090	2004-06-16 11:11:34.000000000 -0400
@@ -0,0 +1,116 @@
+Bug#: 60290
+Product: Mono: Class Libraries
+Version: unspecified
+OS: SUSE 9.1
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Drawing.
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: juergen.moeller@elektrobude.de               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Promlems with x-axis on Bitmaps
+
+Description of Problem: 
+ 
+When drawing on a Bitmap the drawing is repeated left and right of its 
+desired position. a pixel in the first quarter of the bitmap width is 
+found again in the last right quarter of the bitmap. and a pixel which is 
+in the last right qaurter will be found again in the first left quarter 
+of the pixmap. 
+An example is here: http://monoforum.mine.nu/bitmap.jpg 
+ 
+Steps to reproduce the problem: 
+1.  
+Compile this Code 'mcs -r System.Windows.Forms -r System.Drawing 
+bitmap.cs': 
+ 
+using System; 
+using System.Drawing; 
+using System.Windows.Forms; 
+ 
+namespace GraphicsTest 
+{ 
+   public class frmGraphics : System.Windows.Forms.Form 
+   { 
+      private Bitmap DrawingArea;	 
+      private Pen myPen; 
+ 
+      public frmGraphics() 
+      { 
+         myPen = new Pen(Color.Red); 
+         InitializeComponent(); 
+      } 
+ 
+      private void InitializeComponent() 
+      { 
+         this.ClientSize = new System.Drawing.Size(500, 500); 
+         this.Text = "BitmapBug"; 
+         this.Paint += new 
+System.Windows.Forms.PaintEventHandler(this.frmGraphics_Paint); 
+         DrawingArea = new 
+Bitmap(400,400,System.Drawing.Imaging.PixelFormat.Format24bppRgb); 
+         InitializeDrawingArea(); 
+      } 
+ 
+      public static void Main()  
+      { 
+         Application.Run(new frmGraphics()); 
+      } 
+ 
+      private void InitializeDrawingArea() 
+      { 
+          Graphics oGraphics; 
+          oGraphics = Graphics.FromImage(DrawingArea); 
+	   
+          for ( int x = 0; x < 400; x++) 
+          { 
+             oGraphics.DrawLine(myPen, x, 0, x, 400); 
+          } 
+	  myPen.Color = Color.Black; 
+	  oGraphics.DrawLine(myPen,0,0,400,400); 
+          oGraphics.Dispose(); 
+	  this.Invalidate(); 
+       } 
+ 
+  
+      private void frmGraphics_Paint( object sender,  
+                                      System.Windows.Forms.PaintEventArgs 
+e) 
+      { 
+        Graphics oGraphics; 
+ 
+        oGraphics = e.Graphics; 
+ 
+        oGraphics.DrawImage( DrawingArea, 0, 0, DrawingArea.Width, 
+DrawingArea.Height); 
+        oGraphics.Dispose(); 
+      } 
+  } 
+} 
+ 
+ 
+and execute it 'mono bitmap.exe' 
+ 
+ 
+Actual Results: 
+Hard to describe... look here: http://monoforum.mine.nu/bitmap.jpg 
+ 
+ 
+Expected Results: 
+A red square with one black diagonal line 
+ 
+How often does this happen?  
+ 
+always 
+ 
+Additional Information: 
+ 
+It is independent of an absolut offset. the distance where the pixels are 
+repeated is dependent only on the width of the bitmap. It is alway 3/4 of 
+the width.