tgatoc.c
上传用户:qddsws
上传日期:2022-06-22
资源大小:723k
文件大小:0k
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- int main (int argc, char *argv[]) {
- printf ("static unsigned char logo_16bpp[] = { n");
- int in=open(argv[1],O_RDONLY);
- char buffer[255];
- read(in,buffer,18);
- buffer[1]=0;
- int i=0;
- for (i=0;i<800*600*2;i++) {
- read(in,buffer,1);
- buffer[1]=0;
- printf ("0x%x",buffer[0]&0x000000FF);
- if (i!=800*600*2-1) printf (",");
- if ((i+1)%15==0) printf ("n");
- }
- printf ("};");
- return 0;
- }