There is a LoadFromFile, loadFromPixelsPtr and LoadFromMemory.
There is a SaveToFile, GetPixelsPtr, but no "SaveToMemory" method.
I use my own file protocols, saving and loading images along with other data in the same file. I can load them with loadFromMemory, but I can't save them that way. I have to use GetPixelsPtr to send it to a (file) stream, and loadFromPixelsPtr when loading.
But I guess load/save from/to file/memory uses specific image format compression, and so, better than saving the pixels full data.
A SaveToMemory should receive an indication about image format (png, jpg, etc)
I have another question:
- When using LoadFromPixelsPtr, do I have to keep my pointer and free it when the image isn't in use anymore? I would like to just send the pointer to sf::Image and let it take care of it, as I don't need the pointer for anything else (but better would be using the Load & SaveToMemory instead
)
Thanks,
G