Skip to main content

Posts

setfillpattern example in c

Header file:     graphics.h Synopsis:        void setfillpattern(char *pattern);       Description:       setfillpattern() sets user-defined fill pattern. setfillpattern function in c graphics   #include <graphics.h>   #include <stdlib.h>   #include <stdio.h>   #include <conio.h>   #include <dos.h>   int main(void) {         /* request auto detection */         int graphicDriver = DETECT, graphicMode;         int i, j, k = 14, err, midx, midy;         char pattern[8] = {0xaa, 0x55, 0xaa, 0x55,                                   0xaa, 0x55, 0xaa, 0x55};         /* initialize graphics and local variables */         initgraph(&graphicDriver, &graphicMode,   ...

setvisualpage example in c

Header file:     graphics.h Synopsis:        void setvisualpage(int page);       Description:       setvisualpage() sets the visual graphics page number. setvisualpage function in c graphics   #include <graphics.h>   #include <stdlib.h>   #include <stdio.h>   #include <conio.h>   int main(void) {         /* select a driver and mode that supports multiple pages. */         int graphicDriver = EGA, graphicMode = EGAHI;         int err, midx, midy;         /* initialize graphics and local variables */         initgraph(&graphicDriver, &graphicMode,                                         "C:/TURBOC3/BGI");         /* read result of initialization */   ...

setactivepage example in c

Header file:     graphics.h Synopsis:        void setactivepage(int page);       Description:       setactivepage() sets the active page for graphics output.  Our graphics card can support multiple graphics page and the active page might not be the one which is visible onscreen. setactivepage function in c graphics   #include <graphics.h>   #include <stdlib.h>   #include <stdio.h>   #include <conio.h>   int main(void) {         /* select a driver and mode that supports multiple pages. */         int graphicDriver = EGA, graphicMode = EGAHI;         int err, midx, midy;         /* initialize graphics and local variables */         initgraph(&graphicDriver, &graphicMode,                             ...

sector example in c

Header file:     graphics.h Synopsis:        void  sector(int xc, int yc, int stangle, int endangle,  int xradius, int yradius);      (xc, yc) - center of the ellipse(sector)      stangle -starting angle      endangle - ending angle      xradius - radius along x-axis      yradius - radius along y-axis       Description:       sector() draws an elliptical pie slice using the current drawing color and fill it using the same color. sector function in c graphics   #include <graphics.h>   #include <stdlib.h>   #include <stdio.h>   #include <conio.h>   #include <dos.h>   int main(void) {         /* request auto detection */         int graphicDriver = DETECT, graphicMode;         int i, err, midx, midy, xradius = 300, yradius = 150;...

textwidth example in c

Header file:     graphics.h Synopsis:        void textwidth(char *string);       Description:       textwidth() returns width of the given input string in pixels. textwidth function in c graphics   #include <graphics.h>   #include <stdlib.h>   #include <stdio.h>   #include <conio.h>   int main(void) {         /* request auto detection */         int graphicDriver = DETECT, graphicMode;         int err, x = 0, y = 0;         char str[32];         /* initialize graphics and local variables */         initgraph(&graphicDriver, &graphicMode,                                         "C:/TURBOC3/BGI");         /* read result of initialization ...

graphdefaults example in c

Header file:     graphics.h Synopsis:        void graphdefaults();       Description:       graphdefaults() resets all graphics setting(view port, current, background color, drawing color, palette, fill color, fill style, text style etc)  to default values.   graphdefaults function in c graphics   #include <graphics.h>   #include <stdlib.h>   #include <stdio.h>   #include <conio.h>   int main(void) {         /* request auto detection */         int graphicDriver = DETECT, graphicMode;         int err, midx, midy;         /* initialize graphics and local variables */         initgraph(&graphicDriver, &graphicMode,                                         "C:/TURBOC3/B...

getviewsettings example in c

Header file:     graphics.h Synopsis:        void getviewsettings(struct viewporttype *viewport);      struct viewporttype {           int left, top;           int right, bottom, clip;      };       Description:       getviewsettings() gets current viewport information. getviewsettings function in c graphics   #include <graphics.h>   #include <stdlib.h>   #include <stdio.h>   #include <conio.h>   int main(void) {         /* request auto detection */         int graphicDriver = DETECT, graphicMode, err;         struct viewporttype info;         char topleft[32], botright[32], clip[32];         /* initialize graphics and local variables */         initgraph(&graphicDriver, &gra...