#### Archived

This topic is now archived and is closed to further replies.

# Filling an area.

This topic is 7043 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Alright....I don't know if I fully understand what you want, but we'll see about that. I think that you already have a region somewhere (closed ofcourse) that needs to be filled. The best thing to do, and what you probably have, is to use the coordinates of that region.

Alright....the x are your mousecoordinates, i think. Well......Just check that value against the values of every polygon (regions in this example) you have. if the x lays inside the boundaries of your region. Then you save the number of this polygon / region. You stay checking, because there might be another region which could be around the x, and which is smaller than the other.
Alright....then you know which polygon you have to fill. (if two polygons intersect, use a function which makes a polygon of it's own which lays around the x).
And you already know how to fill a polygon i s'pose. Just seek the heighest point, and calculate the slope of the right and left and use that...and so on.

Was that what you meant?

------------------
Dance with me......

##### Share on other sites
Anyone has a good routine how to fill a region for example:
|\
| \
| \
-\x|
| |
---
I will put my pointer at x and then the area must be filled (like windows paint does when you're filling a region).

##### Share on other sites
Ah, if I understand it well I should first search for the top of the region and then check around each pixel that has been drawn (by the filling function) if it has hit its boundaries. If not write another pixel.

(I don't completely understand the last message).

1. 1
2. 2
Rutin
18
3. 3
khawk
15
4. 4
A4L
14
5. 5

• 10
• 13
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633745
• Total Posts
3013667
×