int main(int argc, const char *argv[]){
FILE* fp=fopen("./QQ图片20240507160611.bmp","r+");
//黄色
unsigned char yellow[3]={0,255,255};
//黑色
unsigned char black[3]={0,0,0};
//红色
unsigned char red[3]={0,0,255};
fseek(fp,54,SEEK_SET);
for(int i=0;i<height;i++){
for(int j=0;j<width;j++){
if(i<=(height-1)/3)
fwrite(yellow,3,1,fp);
else if(i<=(height-1)*2/3)
fwrite(red,3,1,fp);
else
fwrite(black,3,1,fp);
}
}
fclose(fp);
return 0;
}
IO进程线程Day2
最新推荐文章于 2024-11-13 21:08:14 发布