Drawing a polygon with holes

Wx_widgets user mailing list, post #12,292
Author:
Date:
Subject:
 personaje
 2008-07-10 17:34:37
 Drawing a polygon with holes
Hello,

I would like to draw a filled polygon that has "holes" in it, the
borders of the holes should be drawn with the current pen. How can I
acomplish this? I went though the painting sample, but couldn't find
what I need.

Regards.
_______________________________________________
wx-users mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wx-users
Author:
Date:
Subject:
 personaje
 2008-07-11 12:28:22
 Re: Drawing a polygon with holes
On Thu, Jul 10, 2008 at 17:34, personaje <[email protected]> wrote:
> Hello,
>
> I would like to draw a filled polygon that has "holes" in it, the
> borders of the holes should be drawn with the current pen. How can I
> acomplish this? I went though the painting sample, but couldn't find
> what I need.
>
> Regards.
>

bump!

anyone? please?
_______________________________________________
wx-users mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wx-users
Author:
Date:
Subject:
 Paul Koning
 2008-07-11 13:57:52
 Re: Drawing a polygon with holes
>>>>> "personaje" == personaje <[email protected]> writes:

personaje> On Thu, Jul 10, 2008 at 17:34, personaje
personaje> <[email protected]> wrote:
>> Hello,
>>
>> I would like to draw a filled polygon that has "holes" in it, the
>> borders of the holes should be drawn with the current pen. How can
>> I acomplish this? I went though the painting sample, but couldn't
>> find what I need.

The book mentions the "fill_style" argument, which defaults to the
"even/odd winding rule". There's a good description of that in your
typical computer graphics or PostScript book (it's not documented in
the wx book, at least not the somewhat out of date rev I have).

You need DrawPolyPolygon. The polygons are (a) the "big" polygon and
(b) the holes (one polygon per hole). Use the default fill_rule.

Even/odd winding rule means (roughly speaking) that if a line from
infinity to some point on your screen crosses an odd number of polygon
boundaries, it's filled in; if an even number, it's not. The area
inside the "hole" polygons is two boundaries away from infinity, so
it's unfilled.

paul

_______________________________________________
wx-users mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wx-users
Author:
Date:
Subject:
 Armel
 2008-07-11 18:32:18
 Re: Drawing a polygon with holes
"personaje" <[email protected]> a écrit dans le message de news:
mailman.652.1215790109.17800.wx-users@lists.wxwidgets.org...
> On Thu, Jul 10, 2008 at 17:34, personaje <[email protected]> wrote:
>> Hello,
>>
>> I would like to draw a filled polygon that has "holes" in it, the
>> borders of the holes should be drawn with the current pen. How can I
>> acomplish this? I went though the painting sample, but couldn't find
>> what I need.
>>
>> Regards.
>>
>
> bump!
>
> anyone? please?
I presume that the only way to do this is to draw the filled polygon on RGBA
DC, then to draw 'for transparency' the inner polygons==holes, then blit all
of that on your target DC

Armel


_______________________________________________
wx-users mailing list
[email protected]
http://lists.wxwidgets.org/mailman/listinfo/wx-users