Fill a polygon region

i have a list of points that represent a region area, to fill this region i am using ExtCreateRegion after many steps like creating a bitmap to get the all rectangles that represent this region area which i think the common method in the internet.

i need a faster algorithm to fill a region represented by a list of points, it should work in wince6.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You will find a lot here (anti-grain geometry):
There are a lot of examples with the source code. You will not need this API, the code will be cross-platform.

Hi zhkhan,

Window's GDI has a function 'Polygon' which draws and fills a polygon. Check if this fulfills your needs - the fill mode can be specified using 'SetPolyFillMode'.

Hope that helps,

zhkhanAuthor Commented:

pgnatyuk, thx for the link it has many samples with source code. i need some time to check the functionality i need then will come back to u.

Zoppo, unfortunately SetPolyFillMode is not supported under wince.
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

Why you didn't say that you need it for Windows CE?

Simply use Polygon:

It exists from 3.0.
Of course AGG is better - antialiasing, subpixeling, etc. But polygon works on WinCE.
Pramod BugudaiCommented:
zhkhanAuthor Commented:

Dear pgnatyuk,

i mentioned that in the first post :
"i need a faster algorithm to fill a region represented by a list of points, it should work in wince6."

my problem is that i have many regions represented by huge number of points, and now i'll test which better either using the polygon direct or may fined something in AGG.
@zhkhan: Ok. sorry. I already forgot and didn't reread.
How I remember, the polygon from Win32 works slow if I had more than 1500 points in polygons. Also the application worked slow when I had too many polygons to draw.
The solution was not in AGG.
There were few fixes. Firstly, prepare the data - I read data from an SD and, in the first implementation, the code was "mixed - I read the data for each polygon, transformed the coordinates and draw the polygon. Everything started to work much faster, when I, firstly, read data for a group of polygons, transformed the coordinates and then draw this group. Instead of one loop I got three loops. But I saved the result from the first two loops and only the third loop worked hard.
The second fix was in an internal function that checked all these polygons - if the polygon is visible right now.
I hope it will help for you too.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zhkhanAuthor Commented:
while testing, i noticed that using Polygon is faster when having many polygons each with more than 1500 points.  the difference is a few seconds depends on the data size.

I prefer to use Polygon because it is faster and simpler.

Anyway, to achieve the  time i need to draw polygons I'll need to minimize the points count as much as possible.

Thanks all
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.