What does "Uint8" refer to? Pixel components, or bytes of a JPG file? In other words, what kind of information is there in the data that you load from your file?
I'm using the GetPixelPtr function to fill the dat file through the ofstream and then using the ifstream to pull it back. It appears to be working up until I'm pulling the data back through the ifstream and then it crashes.
The code looks something like this:
sf::Uint8* myImageArray;
sf::Image test;
void myFunction()
{
test.LoadFromFile("Image1.jpg");
ofstream arrayData("C:\\array.dat", ios::out);
ifstream inData("C:\\array.dat", ios::in);
arrayData << test.GetPixelsPtr() << endl;
arrayData.close();
inData >> myImageArray;
test.LoadFromPixels(600, 600, myImageArray);
};
It's changed slightly as I've been experimenting while waiting, so now what happens is the application crashes on the inData >> myImageArray. Rather than getting an error at compile about being unable to convert to sf::Uint8.
I feel what I have is possibly close to what I need.