Instead ive gone with a differenet aproach,that is to load the file in a hex editor and select all the data , click copy to c and paste that array to the header,but when i open the new image file the picture is blurry and corrupted
Code:
#include <Windows.h>
#include "Data.h"
#include <fstream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
std::fstream fs;
fs.open ("pic.jpg", std::fstream::out,std::fstream::binary);
fs.write((const char*)rawData,130591);
fs.close();
return 0;
}
//The char array looks like this inside Data.h
unsigned char rawData[130591] = {
0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01,
0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43,
0x00, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02,
to big to put here