OK, sorry. I know this subject been in the forum before - I have problems with the setbkcolor function i winbgim
The example at http://www.cs.colorado.edu/~main/bgi/doc/setbkcolor.html
works fine but I can't get setbkcolor() to work in the litle sample program i've downloaded.
Does anyone see what's wrong
Source code below:
include <graphics.h>
include <conio.h>
include <math.h>
include <time.h>
include <stdlib.h>
define PI 3.14159265
void flower(int x, int y, int r)
{
int k;
float x1,y1;
for(k=0;k<=360;k=k+15)
{
x1=rsin(kPI/180.0)+x;
y1=rcos(kPI/180.0)+y;
line(x,y,x1,y1);
}
}
int main(void)
{
int gd=DETECT,gm,k,x,y,r;
srand(time(0));
initwindow(640,480);
(&gd,&gm,"c:\bc32");
I*ve found out that to get the functions
cleardevice();
setbkcolor(3);
working I have to put them in the function
void flower()
why-?
is it not possible to set the backgroundcolor in the beginning of the program?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, sorry. I know this subject been in the forum before - I have problems with the setbkcolor function i winbgim
The example at http://www.cs.colorado.edu/~main/bgi/doc/setbkcolor.html
works fine but I can't get setbkcolor() to work in the litle sample program i've downloaded.
Does anyone see what's wrong
Source code below:
include <graphics.h>
include <conio.h>
include <math.h>
include <time.h>
include <stdlib.h>
define PI 3.14159265
void flower(int x, int y, int r)
{
int k;
float x1,y1;
for(k=0;k<=360;k=k+15)
{
x1=rsin(kPI/180.0)+x;
y1=rcos(kPI/180.0)+y;
line(x,y,x1,y1);
}
}
int main(void)
{
int gd=DETECT,gm,k,x,y,r;
srand(time(0));
initwindow(640,480);
(&gd,&gm,"c:\bc32");
cleardevice();
setbkcolor (MAGENTA); //!!!!!!!
setcolor(YELLOW);
getch();
}
I*ve found out that to get the functions
cleardevice();
setbkcolor(3);
working I have to put them in the function
void flower()
why-?
is it not possible to set the backgroundcolor in the beginning of the program?