#include <head.h>
typedef struct pint
{
unsigned char B;
unsigned char G;
unsigned char R;
}pint_t;
int main(int argc, const char* argv[])
{
FILE* fp;
pint_t rgb;
if (argc != 2) {
fprintf(stderr, "input error,try again\n");
fprintf(stderr, "usage:./a.out picturename\n");
return -1;
}
if ((fp = fopen(argv[1], "r+")) == NULL)
PRINT_ERR("fopen error");
fseek(fp,1109700,SEEK_SET);
memset(&rgb, 0, sizeof(rgb));
for(int i = 528;i<560;i++){
for(int j = 282;j<314;j++){
rgb.G = 255;
fwrite(&rgb,3,1,fp);
}
fseek(fp,2004,SEEK_CUR);
}
fseek(fp,1110080,SEEK_SET);
memset(&rgb, 0, sizeof(rgb));
for(int i = 528;i<560;i++){
for(int j = 282;j<314;j++){
rgb.G = 255;
fwrite(&rgb,3,1,fp);
}
fseek(fp,2004,SEEK_CUR);
}
fclose(fp);
return 0;
}
用IO定点涂鸦
最新推荐文章于 2024-07-25 16:25:24 发布