Re: How to draw with a PEN ?? Please help
- From: "Scott McChesney" <scott@xxxxxxxxxx>
- Date: Tue, 26 Jul 2005 22:22:54 -0500
Pamela -
I'll defer to Frank's much more extensive knowledge in this area. But I can
provide some information about why you are seeing what you're seeing - at
least, what I think is happening - as well as my own suggestions.
When filling a rectangle, GDI (and GDI+) doesn't consider the bottom and
right sides of the rectangle. The algorithm, as I understand it, is defined
such that the area of the rectangle includes the top and left sides, but not
the bottom and right sides. I don't know what your matrix of points looks
like, but given what you're doing, I would guess that you're essentially
working with rectangles that are "twisted" through various transformations
into the shapes you need for each section. Given that, this algorithm is
going to come back and bite you.
You might try modifying the edge-drawing code to only consider the "right"
and "bottom" portions of your edges, since it appears to be your "left" and
"top" edges that are giving you fits. I don't know whether this is
possible, and even if it is, it makes for a bunch of ugly DrawLine code.
The definition of "right and "bottom" may not be intuitively obvious from
the transformations you do, especially given that you need to generalize the
determination. It also adds even more time to the rendering operations,
since once you've twisted your rectangle, you have to examine all points to
find the right and bottom sides. While you could theoretically save some
time in the drawing phase - you're only drawing half the lines, after all -
I don't know whether that would offset all the additional polygon
calculations. Outside of that, Frank's suggestion of one massive polygon is
about all I can offer, and I would heartily agree with him that that's a
tall order.
Frank - would employing a GraphicsPath that contains all the polygon edges
to draw be a possible solution?
- Scott
<expertware@xxxxxxxxx> wrote in message
news:1122398085.968497.162690@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Dear Scott,
>
> thank you very much. Your analysis is enlighting.
> As I understand there is no way to eliminate the problem if I draw the
> edges.
>
> Actually I would be happy to avoid drawing the edges (which slows
> down), but the essential reason
> why I am doing it is that, if I don't, between the faces you can
> sometime see a thin white line (due
> to rounding I guess), which is *very* ugly.
>
> To show this problem , I have placed a picture for you (or any other
> interested) here : http://151.100.3.84/technicalpreview/scott.htm
>
> So back to the problem. How can I get this doughnut transparent and at
> the same time not having
> those ugly white spaces between faces? It would seem an elementary
> issue.
>
> By the way, faces are done simply with this instruction:
> Graphics.FillClosedCurve(FacesBrush, .Points)
>
> Thank you,
>
>
> Pamela
>
.
- Follow-Ups:
- Re: How to draw with a PEN ?? Please help
- From: expertware
- Re: How to draw with a PEN ?? Please help
- References:
- How to draw with a PEN ?? Please help
- From: expertware
- Re: How to draw with a PEN ?? Please help
- From: James Westgate
- Re: How to draw with a PEN ?? Please help
- From: expertware
- Re: How to draw with a PEN ?? Please help
- From: Scott McChesney
- Re: How to draw with a PEN ?? Please help
- From: expertware
- How to draw with a PEN ?? Please help
- Prev by Date: Re: How to draw with a PEN ?? Please help
- Next by Date: Re: How to draw with a PEN ?? Please help
- Previous by thread: Re: How to draw with a PEN ?? Please help
- Next by thread: Re: How to draw with a PEN ?? Please help
- Index(es):
Relevant Pages
|