setfillstyle function sets the current fill pattern and fill color.

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

Different fill styles:

enum fill_styles 
{
EMPTY_FILL,
SOLID_FILL,
LINE_FILL,
LTSLASH_FILL,
SLASH_FILL,
BKSLASH_FILL,
LTBKSLASH_FILL,
HATCH_FILL,
XHATCH_FILL,
INTERLEAVE_FILL,
WIDE_DOT_FILL,
CLOSE_DOT_FILL,
USER_FILL
};

[ad type=”banner”]

C programming source code for setfillstyle

#include<graphics.h>
#include<conio.h>

main()
{
int gd = DETECT, gm;

initgraph(&gd, &gm, "C:\\TC\\BGI");

setfillstyle(XHATCH_FILL, RED);
circle(100, 100, 50);
floodfill(100, 100, WHITE);

getch();
closegraph();
return 0;
}
[ad type=”banner”]

Categorized in: