I wish to create image files in .gif or .jpg format from an opengl implementation in windows xp on Visual Studio .NET C++. I am having trouble trying to find the code to achieve this result. Can you recommend some libraries or code to do this job.
Later on I would like to create an animated gif…but initially would simply like to just output the images.
I did google it, but so far the tools tried dont seem to work…the FAQ’s for opengl seem not to work with many of the libraries missing from the website. If someone can actually recommend something. I do know how to use a web search engine. I want a simple pointer on this. Cheers.
As for getting the pixels themselves from OpenGL you should probably start with the glReadPixels function. That function provides your framebuffer data in a simple uncompressed format such as GL_RGBA.
Sending that data to libpng or to another image library is up to you. OpenGL doesn’t handle that part itself.
If you would prefer a lossy compression library use JPG instead of PNG. JPEG images are smaller on disk than PNG and also lower-quality, although to the eye sometimes you can’t tell the difference. JPEG is what people normally use for family photos etc.
For software images like icons or video game graphics a lossless format like PNG is better.