yes this is true, I was hoping there was a jpeg to array converter or something lol
this way I can load things like jpegs directly intothe binary and load it in a way that I'd like
This is a discussion on Compilable image formats within the C++ Programming forums, part of the General Programming Boards category; yes this is true, I was hoping there was a jpeg to array converter or something lol this way I ...
yes this is true, I was hoping there was a jpeg to array converter or something lol
this way I can load things like jpegs directly intothe binary and load it in a way that I'd like
You're writing code, right? So why can't you create such a tool yourself?
Here it is anyway.
Code:/* anything2c.c */ #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { FILE *infp; char *comma = ""; int ch; int i; infp = fopen(argv[1], "rb"); if(infp == NULL) exit(1); printf("unsigned char %s[] = {\n", argv[2]); while((ch = fgetc(infp)) != EOF) { printf("%s 0x%02X", comma, ch); comma = ",\n"; } printf("\n};\n"); fclose(infp); return 0; }
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Well, there's been no mention of Linux, so I still have to ask o_O
Besides... are there not similar systems in other operating systems, as well?
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Well, not familiar with XPM formats, so I did not know...
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Yes, you are right. The program will be compatible with linux and windows so I want to include the image inside the binary for ease of portability