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>getfillpattern() get user-defined fill pattern</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 getfillpattern()        Get User-Defined Fill Pattern

 #include   <graphics.h>

 void far   getfillpattern(upattern);
 char far   *upattern;

    getfillpattern() gets the user-defined fill pattern (created with
    setfillpattern()) and puts it in the area pointed to by 'upattern'.
    'upattern' points to a sequence of 8 bytes.  Each byte corresponds to
    8 pixels in the pattern.  If a bit in the pattern byte is set to 1,
    the corresponding pixel is drawn.

    Returns:    Nothing.

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

    The following statements get a user-defined fill pattern and then
    draw bar graphs using that fill pattern.

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

           int gdriver = DETECT;
           int gmode;

           main()
           {
               struct fillsettingstype saveset;
               char savepat[8];
               char mypattern[8] = {0xCC,0x33,0xCC,0x33,0xCC,0x33,0xCC,0x33};

               initgraph(&gdriver,&gmode,"");
               setfillpattern(mypattern,BLUE);
               getfillsettings(&saveset);
               if (saveset.pattern == USER_FILL)
               getfillpattern(savepat);
               bar(10,10,100,100);
               setfillpattern(savepat,RED);
               bar(200,10,300,100);
               setfillpattern(savepat,saveset.color);
               bar(400,10,500,100);
               getch();
               closegraph();
           }


See Also: fillpoly() floodfill() getfillsettings() setfillstyle()

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