setfillstyle function sets the current fill pattern and fill color.

Declaration :- void setfillstyle( int pattern, int color);

Different fill styles:

[pastacode lang=”c” manual=”enum%20fill_styles%20%0A%7B%20%0A%20%20%20EMPTY_FILL%2C%20%0A%20%20%20SOLID_FILL%2C%20%0A%20%20%20LINE_FILL%2C%20%0A%20%20%20LTSLASH_FILL%2C%20%0A%20%20%20SLASH_FILL%2C%0A%20%20%20BKSLASH_FILL%2C%20%0A%20%20%20LTBKSLASH_FILL%2C%20%0A%20%20%20HATCH_FILL%2C%20%0A%20%20%20XHATCH_FILL%2C%20%0A%20%20%20INTERLEAVE_FILL%2C%0A%20%20%20WIDE_DOT_FILL%2C%20%0A%20%20%20CLOSE_DOT_FILL%2C%20%0A%20%20%20USER_FILL%20%0A%7D%3B” message=”” highlight=”” provider=”manual”/]

[ad type=”banner”]

C programming source code for setfillstyle

[pastacode lang=”c” manual=”%23include%3Cgraphics.h%3E%0A%23include%3Cconio.h%3E%0A%20%0Amain()%0A%7B%0A%20%20%20int%20gd%20%3D%20DETECT%2C%20gm%3B%0A%20%0A%20%20%20initgraph(%26gd%2C%20%26gm%2C%20%22C%3A%5C%5CTC%5C%5CBGI%22)%3B%0A%20%0A%20%20%20setfillstyle(XHATCH_FILL%2C%20RED)%3B%0A%20%20%20circle(100%2C%20100%2C%2050)%3B%0A%20%20%20floodfill(100%2C%20100%2C%20WHITE)%3B%0A%20%0A%20%20%20getch()%3B%0A%20%20%20closegraph()%3B%0A%20%20%20return%200%3B%0A%7D” message=”” highlight=”” provider=”manual”/] [ad type=”banner”]

Categorized in: