[Mono-bugs] [Bug 82511][Nor] New - The linear gradient is not drawn correctly when LinearGradientBrush.Transform property is used

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Aug 20 23:27:14 EDT 2007


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 roman.s at sbcglobal.net.

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

--- shadow/82511	2007-08-20 23:27:14.000000000 -0400
+++ shadow/82511.tmp.15689	2007-08-20 23:27:14.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 82511
+Product: Mono: Class Libraries
+Version: 1.2
+OS: other
+OS Details: Ubuntu 7.04
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Drawing.
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: roman.s at sbcglobal.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: The linear gradient is not drawn correctly when LinearGradientBrush.Transform property is used
+
+Hi,
+
+OS: Ubuntu 7.04
+Mono: 1.2.4_06
+
+Steps to reproduce:
+
+1. Create a new WinForm application in Visual Studio 2005
+2. Override the OnPaint method:
+
+        protected override void OnPaint(PaintEventArgs e)
+        {
+            base.OnPaint(e);
+
+            Rectangle rect = new Rectangle(10, 10, 10, 10);
+
+            Point[] points = new Point[] {
+                new Point(100, 100), 
+                new Point(200, 100),
+                new Point(100, 200)
+            };
+
+            LinearGradientBrush brush = new LinearGradientBrush(
+                new Point(10, 10), 
+                new Point(15, 10), 
+                Color.Red, 
+                Color.Yellow);
+
+            brush.Transform = new Matrix(rect, points);
+            brush.WrapMode  = WrapMode.TileFlipX;
+
+            Pen pen = new Pen(Color.Black);
+
+            e.Graphics.FillRectangle(brush, 100, 100, 100, 100);
+            e.Graphics.DrawRectangle(pen, 100, 100, 100, 100);
+        }
+
+3. Run the application:
+
+    MS .NET 2.0: linear gradient is centered (as expected)
+    Mono 1.2.4:  linear gradient is shifted
+
+Regards, Roman.


More information about the mono-bugs mailing list