Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>getfillsettings() get current fill pattern and fill color</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getfillsettings()       Get Current Fill Pattern and Fill Color

 #include   <graphics.h>

 void far                    getfillsettings(fillinfo);
 struct fillsettingstype far *fillinfo;

    getfillsettings() gets information about the current fill pattern and
    fill color.  The information is stored in the 'fillsettingstype'
    structure pointed to by 'fillinfo'.  The 'fillsettingstype' structure
    is defined in <graphics.h> :

          struct fillsettingstype {
               int pattern;
               int color;
          };

    There are 11 predefined fill patterns. In addition you can fill a
    shape in with the background color or a user-defined pattern. The
    names for the predefined patterns are found in 'fill_patterns' in
    <graphics.h>:

     Name           Value     Description
     EMPTY_FILL       0       Fill with background color
     SOLID_FILL       1       Solid fill
     LINE_FILL        2       Fill with horizontal lines
     LTSLASH_FILL     3       Fill with ///, regular lines
     SLASH_FILL       4       Fill with ///, thick lines
     BKSLASH_FILL     5       Fill with \\\, thick lines
     LTBKSLASH_FILL   6       Fill with \\\, regular lines
     HATCH_FILL       7       Fill with hatch fill
     XHATCH_FILL      8       Fill with heavy hatch fill
     INTERLEAVE_FILL  9       Interleaving line fill
     WIDE_DOT_FILL   10       Widely spaced dot fill
     CLOSE_DOT_FILL  11       Closely spaced dot fill
     USER_FILL       12       User-defined fill pattern

    All patterns except EMPTY_FILL use the current fill color.

    Returns:    Nothing.

   -------------------------------- Example ---------------------------------

    The following statements save the current fill pattern and fill color
    and then restore them.

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

           int gdriver = DETECT;
           int gmode;

           main()
           {
               struct fillsettingstype saveset;
               int pat, clr;

               initgraph(&gdriver,&gmode,"");
               getfillsettings(&saveset);
                .
                .
           /* change pattern and color settings */
                .
                .
               setfillstyle(saveset.pattern,saveset.color);
               closegraph();
           }


See Also: bar() fillpoly() floodfill() getfillpattern() setfillstyle()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson