<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: rectangle code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Mon, 06 Oct 2008 09:51:34 GMT</pubDate>
    <description>DZone Snippets: rectangle code</description>
    <item>
      <title>Draw round corner rectangle</title>
      <link>http://snippets.dzone.com/posts/show/3896</link>
      <description>&lt;code&gt;&lt;br /&gt;        public void DrawRoundRect(Graphics g, Pen p, float X, float Y, float width, float height, float radius)&lt;br /&gt;        {&lt;br /&gt;            GraphicsPath gp = new GraphicsPath();&lt;br /&gt;&lt;br /&gt;            gp.AddLine(X + radius, Y, X + width - (radius * 2), Y);&lt;br /&gt;            gp.AddArc(X + width - (radius * 2), Y, radius * 2, radius * 2, 270, 90);&lt;br /&gt;            gp.AddLine(X + width, Y + radius, X + width, Y + height - (radius * 2));&lt;br /&gt;            gp.AddArc(X + width - (radius * 2), Y + height - (radius * 2), radius * 2, radius * 2, 0, 90);&lt;br /&gt;            gp.AddLine(X + width - (radius * 2), Y + height, X + radius, Y + height);&lt;br /&gt;            gp.AddArc(X, Y + height - (radius * 2), radius * 2, radius * 2, 90, 90);&lt;br /&gt;            gp.AddLine(X, Y + height - (radius * 2), X, Y + radius);&lt;br /&gt;            gp.AddArc(X, Y, radius * 2, radius * 2, 180, 90);&lt;br /&gt;            gp.CloseFigure();&lt;br /&gt;&lt;br /&gt;            g.DrawPath(p, gp);&lt;br /&gt;            gp.Dispose();&lt;br /&gt;        }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 24 Apr 2007 22:46:51 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3896</guid>
      <author>mstampar (Miroslav Stampar)</author>
    </item>
  </channel>
</rss>
