I'm creating a simple graphic editor by C/glut. So I just wonder how can I save my draws as PNG, BMP etc. I tried png.h but didn't work for me. I didn't get any errors but it did not save anything.
Any advice?
I'm creating a simple graphic editor by C/glut. So I just wonder how can I save my draws as PNG, BMP etc. I tried png.h but didn't work for me. I didn't get any errors but it did not save anything.
Any advice?
You can easily save bmp images from your app using libsoil.
For example, I used:
int save_result = SOIL_save_screenshot(
filename,
SOIL_SAVE_TYPE_BMP,
0,0,
width, height
);
If you are a debian user, there is a package named libsoil-dev
. It should be available in Ubuntu too.