Saturday 15 September 2012

c - Computer Graphics error in Code Block Compiler -



c - Computer Graphics error in Code Block Compiler -

i using code blocks compiler computer graphics pogramming in c. while building next program, getting error:" graphics.h: no such file or directory"- while same programme runs on turbo c/c++ compiler. here code:

#include<stdio.h> #include<conio.h> #include<graphics.h> void boundary_fill(int x, int y, int fcolor, int bcolor) { if ((getpixel(x, y) != fcolor) && (getpixel(x, y) != bcolor)) { putpixel(x, y, fcolor); boundary_fill(x + 1, y, fcolor, bcolor); boundary_fill(x - 1, y, fcolor, bcolor); boundary_fill(x, y - 1, fcolor, bcolor); boundary_fill(x, y + 1, fcolor, bcolor); boundary_fill(x + 1, y - 1, fcolor, bcolor); boundary_fill(x + 1, y + 1, fcolor, bcolor); boundary_fill(x - 1, y - 1, fcolor, bcolor); boundary_fill(x - 1, y + 1, fcolor, bcolor); } } void main() { int x, y, fcolor, bcolor; clrscr(); printf("enter seed point (x,y) : "); scanf("%d%d", &x, &y); printf("enter boundary color : "); scanf("%d", &bcolor); printf("enter new color : "); scanf("%d", &fcolor); int gd = detect, gm = detect; initgraph(&gd, &gm, ""); cleardevice(); /* please ceate own shapes create closed area. */ boundary_fill(x, y, fcolor, bcolor); getch(); }

c graphics

No comments:

Post a Comment