[Mono-bugs] [Bug 66666][Nor] New - System.Drawing.Pen.Width=1 is twice as thick as should be

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 23 Sep 2004 04:55:35 -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 david@quintana.org.

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

--- shadow/66666	2004-09-23 04:55:35.000000000 -0400
+++ shadow/66666.tmp.4664	2004-09-23 04:55:35.000000000 -0400
@@ -0,0 +1,77 @@
+Bug#: 66666
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: Windows and Linux
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Drawing.
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: david@quintana.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Drawing.Pen.Width=1 is twice as thick as should be
+
+Description of Problem:
+Drawing a line of width = 1 is twice as thick when using Mono on Linux as
+when using Mono on Windows.  Run the following code on both Linux and
+Windows and compare the resulting images.  The code draws alternating black
+and red lines of width = 1.
+
+using System;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Drawing.Imaging;
+
+public class LineWidthTest
+{
+
+	public static void Main()
+	{
+		float lineWidth = 1;
+		
+		Bitmap bImg 	= new Bitmap( 400, 300 );
+		Graphics graphics	= Graphics.FromImage(bImg);
+
+		SolidBrush regularBrush = new SolidBrush(Color.White);
+		Pen blackLine = new Pen(Color.Black, lineWidth);
+		Pen redLine = new Pen(Color.Red, lineWidth);
+		
+		//Make a white background
+		graphics.FillRectangle(regularBrush, 0, 0, 400, 300 );
+
+		for (int i=10; i < 290; i=i+10)
+		{
+			graphics.DrawLine(blackLine, 5,i,395,i);
+			graphics.DrawLine(redLine, 5,i+5,395,i+5);
+		}
+
+		bImg.Save("linewidthtest.png",ImageFormat.Png);
+
+
+	}
+
+}
+
+
+
+Steps to reproduce the problem:
+1. Run code on both Windows and Linux
+2. Compare images
+3. 
+
+Actual Results:
+The Mono/Linux created line is twice the thickness as the Mono/Windows
+line.  The Mono/Windows line is exactly the same as the .NET/Windows line.
+
+Expected Results:
+Lines should look exactly the same.
+
+How often does this happen? 
+Always.
+
+Additional Information: