编程论坛's Archiver

peswe 发表于 2007-5-27 22:27

为什么不能填充

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

peswe 发表于 2007-5-29 22:01

不是吧,图形专区也没人会啊!~[em13]

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.