putimage(),完全相同的三个,前两个ok,第三个涂出来是个白框,这不科学!!!
void *buff[3][2];int b[3][2];
b[0][0]=imagesize(100,150,200,200);
buff[0][0]=malloc(b[0][0]);
int x=130,y=170;
char *h1={"规则"};
char *h2={"操作"};
char *h3={"游戏"};
char *h11={"规则"};
char *h22={"操作"};
char *h33={"游戏"};
open_hzk(/*hzk_p*/);
setlinestyle(0,0,1);
/* top */
setcolor(BROWN);
rectangle(100,150,200,200);
rectangle(110,160,190,190);
line(100,150,110,160);
line(200,150,190,160);
line(100,200,110,190);
line(200,200,190,190);
setfillstyle(1,LIGHTGRAY);
floodfill(150,151,BROWN);
floodfill(101,170,BROWN);
setfillstyle(1,WHITE);
floodfill(199,170,BROWN);
floodfill(150,199,BROWN);
floodfill(150,175,BROWN);
while (*h1!=NULL)
{
while (*h1!=NULL)
{
dishz(x,y,h1,BROWN);
x+=20;
h1+=2;
}
}
/* middle */
x=130,y=270;
rectangle(100,250,200,300);
rectangle(110,260,190,290);
line(100,250,110,260);
line(200,250,190,260);
line(100,300,110,290);
line(200,300,190,290);
setfillstyle(1,LIGHTGRAY);
floodfill(150,251,BROWN);
floodfill(101,270,BROWN);
setfillstyle(1,WHITE);
floodfill(199,270,BROWN);
floodfill(150,299,BROWN);
floodfill(150,275,BROWN);
while (*h2!=NULL)
{
while (*h2!=NULL)
{
dishz(x,y,h2,BROWN);
x+=20;
h2+=2;
}
}
/* under */
x=130,y=370;
rectangle(100,350,200,400);
rectangle(110,360,190,390);
line(100,350,110,360);
line(200,350,190,360);
line(100,400,110,390);
line(200,400,190,390);
setfillstyle(1,LIGHTGRAY);
floodfill(150,351,BROWN);
floodfill(101,370,BROWN);
setfillstyle(1,WHITE);
floodfill(199,370,BROWN);
floodfill(150,399,BROWN);
floodfill(150,375,BROWN);
while (*h3!=NULL)
{
while (*h3!=NULL)
{
dishz(x,y,h3,BROWN);
x+=20;
h3+=2;
}
}
/***************push************/
x=330,y=170;
setcolor(BROWN);
rectangle(300,150,400,200);
rectangle(310,160,390,190);
line(300,150,310,160);
line(400,150,390,160);
line(300,200,310,190);
line(400,200,390,190);
setfillstyle(1,WHITE);
floodfill(350,151,BROWN);
floodfill(301,170,BROWN);
floodfill(350,175,BROWN);
setfillstyle(1,LIGHTGRAY);
floodfill(399,170,BROWN);
floodfill(350,199,BROWN);
while (*h11!=NULL)
{
while (*h11!=NULL)
{
dishz(x,y,h11,BROWN);
x+=20;
h11+=2;
}
}
/* middle */
x=330,y=270;
rectangle(300,250,400,300);
rectangle(310,260,390,290);
line(300,250,310,260);
line(400,250,390,260);
line(300,300,310,290);
line(400,300,390,290);
setfillstyle(1,WHITE);
floodfill(350,251,BROWN);
floodfill(301,270,BROWN);
floodfill(350,275,BROWN);
setfillstyle(1,LIGHTGRAY);
floodfill(399,270,BROWN);
floodfill(350,299,BROWN);
while (*h22!=NULL)
{
while (*h22!=NULL)
{
dishz(x,y,h22,BROWN);
x+=20;
h22+=2;
}
}
/* under */
x=330,y=370;
rectangle(300,350,400,400);
rectangle(310,360,390,390);
line(300,350,310,360);
line(400,350,390,360);
line(300,400,310,390);
line(400,400,390,390);
setfillstyle(1,WHITE);
floodfill(350,351,BROWN);
floodfill(301,370,BROWN);
floodfill(350,375,BROWN);
setfillstyle(1,LIGHTGRAY);
floodfill(399,370,BROWN);
floodfill(350,399,BROWN);
while (*h33!=NULL)
{
while (*h33!=NULL)
{
dishz(x,y,h33,BROWN);
x+=20;
h33+=2;
}
}
}
getimage(100,150,200,200,buff[0][0]);
b[0][1]=imagesize(300,150,400,200);
buff[0][1]=malloc(b[0][1]);
getimage(300,150,400,200,buff[0][1]);
b[1][0]=imagesize(100,250,200,300);
buff[1][0]=malloc(b[1][0]);
getimage(100,250,200,300,buff[1][0]);
b[1][1]=imagesize(300,250,400,300);
buff[1][1]=malloc(b[1][1]);
getimage(300,250,400,300,buff[1][1]);
b[2][0]=imagesize(100,350,200,400);
buff[2][0]=malloc(b[2][0]);
getimage(100,350,200,400,buff[2][0]);
b[2][1]=imagesize(300,350,400,400);
buff[2][1]=malloc(b[2][1]);
getimage(300,350,400,400,buff[2][1]);
putimage(100,150,buff[0][0],COPY_PUT);
putimage(100,250,buff[1][0],COPY_PUT);
putimage(100,350,buff[2][0],COPY_PUT);
部分代码,为什么putimage前两个涂出来是对的,最后一个是个白框,而且原图我也看了,没问题