{
inti,j,n,m,t;
longlen;
unsignedcharfar*p,far*q,cc,ch;
unsignednn;
fseek(fp,54L,SEEK-SET);
len=ftell(fp);
fwrite(&palette[0][0],4,256,fp);
p=(unsignedcharfar*)farmalloc(bytes+1);
len=ftell(fp);
for(i=0;idepth;i++){
fseek(fp,len,SEEK-SET);
fread(p,bytes,1,fp);
fseek(fp,len,SEEK-SET);
len+=bytes;
q=p;
for(j=0;jwidth;j++,q++){
cc=(unsignedchar)(*q);
ch=BB[cc];
*q=ch;
}
fwrite(p,bytes,1,fp);
}
farfree(p);
}
main(intargc,char*args[])
{
FILE*fp;
if(argc4){
printf("参数:文件名颜色下限颜色上限“n");
return;
}
fp=get-bitmap-file(args[1]);
if(fp==NULL)return;
zh-fan-tu(fp,atoi(args,atoi(args));
w-create-bitmap(fp);
fclose(fp);
}
参考文献
王旭张军译。MicrosoftWindows3。1程序员参考手册。北京:清华大学出版社,1994
(责任编辑:一枝笔写作)