By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,694 Members | 1,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,694 IT Pros & Developers. It's quick & easy.

Points contained within a path

P: n/a
In my app the user can draw an arbitrary path onto an image. Now I need to
determine all of the pixels that are contained within that path. Note that
the path can intersect itself and I can always assume that the path is
closed. Are there any articles, algorithms, tools, etc. that can assist with
determining which pixels are contained within the path?

Thanks,
Lance

Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
LjLevend,

Not that you should go there however there is maybe an interesting newsgroup
for your question.

microsof.public.dotnet.framework.drawing

Maybe you find your answer there from more persons than here?

Cor
"ljlevend"
In my app the user can draw an arbitrary path onto an image. Now I need
to
determine all of the pixels that are contained within that path. Note
that
the path can intersect itself and I can always assume that the path is
closed. Are there any articles, algorithms, tools, etc. that can assist
with
determining which pixels are contained within the path?

Thanks,
Lance

Nov 21 '05 #2

P: n/a

"ljlevend" <lj******@nospam.nospam> wrote in message
news:FC**********************************@microsof t.com...
In my app the user can draw an arbitrary path onto an image. Now I need
to
determine all of the pixels that are contained within that path. Note
that
the path can intersect itself and I can always assume that the path is
closed. Are there any articles, algorithms, tools, etc. that can assist
with
determining which pixels are contained within the path?


Your closed path is a polygon. Filliing a polygon on the screen is an old
and throughly solved problem.

Here's some keywords to get you started on Google.

polygon fill algorithm
Scanline Fill Algorithm
Boundary fill Algorithm
Flood fill Algorithm
David
Nov 21 '05 #3

P: n/a
Hi,

Take look at the graphicspath isvisible, pathdata, and pathpoints.

http://msdn.microsoft.com/library/de...sibletopic.asp

http://msdn.microsoft.com/library/de...hdatatopic.asp

http://msdn.microsoft.com/library/de...ointstopic.asp

Ken
-------------------
"ljlevend" <lj******@nospam.nospam> wrote in message
news:FC**********************************@microsof t.com...
In my app the user can draw an arbitrary path onto an image. Now I need to
determine all of the pixels that are contained within that path. Note that
the path can intersect itself and I can always assume that the path is
closed. Are there any articles, algorithms, tools, etc. that can assist
with
determining which pixels are contained within the path?

Thanks,
Lance
Nov 21 '05 #4

P: n/a
Thanks a lot for the topic ideas. I need to determine the points contained
in the polygon in real-time (as the user moves the polygon with the mouse) so
speed is a primary concern. The scanline algorithm sounds like the fastest,
but I couldn't find any samples in VB or C#. Do you know of any?

Thanks again,
Lance

Nov 21 '05 #5

P: n/a
Thanks.
Nov 21 '05 #6

P: n/a

"ljlevend" <lj******@nospam.nospam> wrote in message
news:D1**********************************@microsof t.com...
Thanks a lot for the topic ideas. I need to determine the points
contained
in the polygon in real-time (as the user moves the polygon with the mouse)
so
speed is a primary concern. The scanline algorithm sounds like the
fastest,
but I couldn't find any samples in VB or C#. Do you know of any?


If speed is of the utmost importance you might not want to use a canned
implementation anyway.

Just hook the mouse move event and trace one scanline: from the mouse's
current position to the edge.

David
Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.