all groups > dotnet drawing api > april 2006 >
You're in the

dotnet drawing api

group:

drawing a border around a region


drawing a border around a region PJ6
4/27/2006 6:24:35 PM
dotnet drawing api:
I have a region that was created by cloning one, and excluding another.

How do I draw a border around this new region? There is no graphics path.

Paul

Re: drawing a border around a region Randolpho
4/28/2006 6:14:52 AM
It ain't easy.

Check out this thread:

http://groups.google.com/group/microsoft.public.dotnet.framework.drawing/browse_thread/thread/db61626afd4a15d9/a5364576fe4c451d

Here are some highlights -- it's nearly impossible (but not entirely
impossible) to go from a Region to a GraphicsPath, and you need a
GraphicsPath to draw an outline. If you have access to the original
GraphicsPaths that created the Regions, you might try building your
result from them rather than from Regions.

If all else fails, you *could* try scaling the Region slightly, filling
it with your border color, then filling the original Region on top of
it. That's a hack, at best, but it might work.
Re: drawing a border around a region PJ6
4/28/2006 9:36:32 AM
Bah!!!

Maybe I *should* go to DirectX.

[quoted text, click to view]

Re: drawing a border around a region PJ6
4/30/2006 9:11:20 AM
OK that limitation was a good thing... for the cases I'm working with, it's
actually trivial to subtract one region from another if you start with the
originating points, provided they're already ordered. I think from now on
I'm going to try to completely avoid using the built-in region operations
since I can do them myself upstream, probably more efficiently, too.

Paul

[quoted text, click to view]

AddThis Social Bookmark Button