Drawing a region using a wxGCDC
teemo10
teemo10 at gmail.com
Tue Jan 1 06:30:16 PST 2008
On Dec 14 2007, 6:25 pm, arka... at gmail.com ("Chris Mellon") wrote:
> On Dec 14, 2007 4:02 PM, teemo10 <teem... at gmail.com> wrote:
>
>
>
> > I am trying to draw a rectangle with 2 rounded corners, and 2 square
> > corners. I am wondering if there is a way to construct and draw such
> > a region using awxGCDC. I tried doing this using wxGraphicsPath, but
> > each region is drawn separately, so i get a rounded rectangle with a
> > small rectangle drawn on each corner drawn on it.
>
> Draw the line segments individually as a single path.
>
> For example, if the rectangle is (0,0,100,100), the radius of the
> curve is 10px, and it's the bottom two corners you want rounded:
>
> path = context.CreatePath()
> path.MoveToPoint(0,0)
> path.AddLineToPoint(0,100)
> path.AddLineToPoint(90,100)
> path.AddArc(90, 90, 10, 0, math.radians(90))
> path.AddLineToPoint(10,100)
> path.AddArc(10, 90, 10, math.radians(90), math.radians(180))
> path.CloseSubpath()
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscr... at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-h... at lists.wxwidgets.org
The solution to this post can be found in the following link:
http://wxforum.shadonet.com/viewtopic.php?t=17122
Thanks for you help Chris. :)
More information about the wx-users
mailing list