473,503 Members | 9,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Points contained within a path

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
6 1730
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

"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
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
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
Thanks.
Nov 21 '05 #6

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1636
by: Maxd out | last post by:
Hi all As a newbie to C++ just wondering if you can compare a user input e.g. the integer 2 to see if that integer is contained within a parameter list. If so how can it be done and can it be...
1
1348
by: Yaron | last post by:
Hi I am drawing two points (which could have any coordinates), and a path between them. The problem is, I want to know when a user clicks on this path between them. I am confused as to how I would...
1
449
by: G.A.Mashaqbeh via DotNetMonster.com | last post by:
can anybody help me?? using the mouse i let the user to draw a shape about a set of points, i want to define the points enclosed within this shape, the shape is irregular, i have saved all the...
2
4011
by: John | last post by:
Hi all, How do I iterate through a specific placeholder and remove or hide all controls contained within that placeholder? Regards John.
5
3563
by: Jeff Johnson | last post by:
I'm using forms authentication to protect a subfolder within my site. I've got it working fine except for two issues: (1) When I do a RedirectFromLogin page I have to put a cookie path ("/"...
2
1661
by: theinvisibleGhost | last post by:
Subject says it all really. I'm being passed a string, and I'm wondering if theres an easy way to determine what exactly the string points at? Cheers Chris.
8
1545
by: bevanward | last post by:
Hi all I have a large data set of points situated in 3d space. I have a simple primary key and an x, y and z value. What I would like is an efficient method for finding the group of points...
14
3727
by: Adnan Siddiqi | last post by:
Hi Suppose I have following URLs comming from an HTML document <a href="http://mydomain1.com">Domain1</a> <a...
1
1545
by: kimt | last post by:
Hello, I am currently writing an application that involves many (> 1000) points on a (x,y) plane. I am using a struct to contain the position information, and I have the structs contained in a STL...
0
7193
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5562
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.