# help how to make polygon

• 02-20-2005
gamett711221
help how to make polygon
plz tell how to write the program for filling a polygon in electronic fashion and u may fill it with pixel and first generate a polygon as shown below then fill the polygon, all slope lines are 45 degrees.

__________________
| |
| |
| |
| |
| |
| |
| /\ |
| / \ |
| / \ |
| / \ |
| / \ |
| / \ |
|/ \ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\|
• 02-20-2005
Salem
> how to write the program for filling a polygon

type in
polygon fill algorithm

• 02-20-2005
Krak
Sorry hun, this belongs more to the world of OpenGL.
• 02-20-2005
The Brain
Using Win32 primitive drawing, you could use this function:

BOOL Polygon(HDC, hDC, CONST POINT* pt, int iCount);

All you have to do, is to fill an array with points.. and it will connect them for you.

Code:

```void GamePaint(HDC hDC) {     POINT points[3];     points[0] = { 5, 10};     points[1] = {25, 30};     points[2] = {15, 20};     Polygon(hDC, points, 3); }```