Including a JPEG file

May 3, 2013 at 3:29am
How to include a jpeg file into a c++ program??
May 3, 2013 at 3:34am
You need to use an API, as core c++ doesn't support it. I'm not sure what you need to be loading the jpeg for so hard to say what API you should use.
May 3, 2013 at 3:58am
Do you mean embedding into executable itself and access it at runtime as a unsigned char* of a known size ?

If so, then open the jpeg file in a hex editor and export them as a unsigned char* (Hex Workshop for example has this option, not all hex editors have it).

Another idea is to use convert utility from ImageMagick and convert jpeg to a XPM file, which is just that: a C style header.
Topic archived. No new replies allowed.