为什么不能填充,望高手指点!~
#include "stdio.h"
#include <graphics.h>
#include <stdlib.h>
#include <conio.h>
void DrawQiPan(int x,int y,int row,int colum,int width);
main()
{
int driver=DETECT,mode;
int x=250,y=200,width=8,row=8,colum=8;
initgraph(&driver,&mode," ");
cleardevice();
setbkcolor(3);
setcolor(4);
DrawQiPan(x,y,row,colum,width);
getch();
closegraph();
}
void DrawQiPan(int x,int y,int row,int colum,int width)
{
int i,j;
for(i=0;i<row;i++)
{
for(j=0;j<colum;j++)
{
if((i+j)%2==0)
{
rectangle(x+i*width,y+j*width,x+(i+1)*width,y+(j+1)*width);
}
if((i+j)%2!=0)
{
setfillstyle(LTSLASH_FILL,0);
rectangle(x+i*width,y+j*width,x+(i+1)*width,y+(j+1)*width);
/*setfillstyle(LTSLASH_FILL,BLACK);*/
}
}
}
}