[Mono-bugs] [Bug 457021] New: GraphicsPath. AddString does not respect StringFormat Alignments

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Dec 5 21:53:41 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=457021


           Summary: GraphicsPath.AddString does not respect StringFormat
                    Alignments
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Drawing.
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: scott.ellington at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=258425)
 --> (https://bugzilla.novell.com/attachment.cgi?id=258425)
Mono output

You can pass GraphicsPath.AddString a StringFormat object, but setting the
alignments does not work on Mono.  Test code:

Bitmap b = new Bitmap(400, 400);

using (Graphics g = Graphics.FromImage(b))
{
        Rectangle r = new Rectangle(50, 50, 300, 100);

        StringFormat sf = new StringFormat();
        sf.LineAlignment = StringAlignment.Center;
        sf.Alignment = StringAlignment.Center;

        GraphicsPath gp = new GraphicsPath();
        gp.AddString("Hi There", FontFamily.GenericMonospace, 0, 24, r, sf);

        g.DrawPath(new Pen(Color.Black), gp);

        g.DrawRectangle(new Pen(Color.Red), r);
}

b.Save("out.png");

Attached are examples of both mono and ms.net


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list