[Mono-bugs] [Bug 76846][Nor] New - Bugs in AddArc routine.
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Nov 28 23:47:56 EST 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 miguel at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76846
--- shadow/76846 2005-11-28 23:47:56.000000000 -0500
+++ shadow/76846.tmp.25823 2005-11-28 23:47:56.000000000 -0500
@@ -0,0 +1,60 @@
+Bug#: 76846
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Drawing.
+AssignedTo: jordi at ximian.com
+ReportedBy: miguel at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Bugs in AddArc routine.
+
+The following example draws an incorrect arc:
+
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Drawing.Drawing2D;
+
+class X {
+ static Rectangle m_boundingRectangle = new Rectangle (0, 0, 600, 300);
+ static int m_sliceHeight = 100;
+
+ static GraphicsPath MakePath (float startAngle, float endAngle,
+PointF pointStart, PointF pointEnd) {
+ GraphicsPath path = new GraphicsPath();
+
+ path.AddArc(m_boundingRectangle, startAngle, endAngle -
+startAngle);
+ path.AddLine(pointEnd.X, pointEnd.Y, pointEnd.X, pointEnd.Y +
+m_sliceHeight);
+ path.AddArc(m_boundingRectangle.X, m_boundingRectangle.Y +
+m_sliceHeight, m_boundingRectangle.Width, m_boundingRectangle.Height,
+endAngle, startAngle - endAngle);
+ path.AddLine(pointStart.X, pointStart.Y + m_sliceHeight,
+pointStart.X, pointStart.Y);
+ return path;
+ }
+
+ static void Main ()
+ {
+ Bitmap b = new Bitmap (800, 400, PixelFormat.Format32bppArgb);
+ Graphics g = Graphics.FromImage (b);
+ GraphicsPath p = MakePath (45, 180, new PointF (338, 160), new PointF
+(46, 93));
+ Pen pen = new Pen (Color.Red);
+ g.DrawPath (pen, p);
+
+ b.Save ("s.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
+ }
+}
+
+
+The expected and obtained results are attached.
More information about the mono-bugs
mailing list