Exporting to a bitmap


I need to render whole scene to a bitmap. How can I do that? Is it even possible?

I am searching for a library that allows me to do it. Something I could set the resulution (DPI) with…

Search and GOOGLE spring to mind or even FAQ’s,

this question has been answered many many time are there are hundreds if not thousands of example around

I am sorry, but I am searching. Words “OpenGL” and “export” are very general - google gives wrong results.

Which FAQ? I will do, but please direct me…

You can use glReadPixels to read the rendered pixels from the framebuffer. All you have to do is write those pixel values to a bitmap file.

Thank you for pointing me at glReadPixels - this seems like a very nice solution. The hard pard is the resolution - I cannot manipulate with the DPI with the glReadPixels.

Is there any other way? I will use this if I wont find anything else.

Thanky you very much for your help.

resolution = nb pixel / realworld size
It only depends on the output size you want.

On searching you could use different key words for searching, like ‘capture’ , ‘framebufer’ and ‘write’ to ‘bitmap’ ‘jpg’ ‘DPI’ etc…

Your DPI is typically fixed to the output device,

So maybe the best you can probably do is to render to the highest resolution you can and then down size that to a higher DPI resolution, obviosuly your image will shrink in physical size

There are high resolution monitors 200/300 and higher DPI rather than standard 72/96 dpi but they are very expensive to say the least, we have some here, so another option is to get a higher resolution DPI device

Look at http://openil.sourceforge.net/

It has some usefull functions for image manipulation

What does DPI have to do with rendering or bitmaps?

You just have to know how big the bitmap should be in pixels. That’s the parameters you put into glViewport and glReadPixels.

DPI is only important when displaying or printing something. It’s just a number, and has nothing to do with the actual data in the bitmap.

I googled I need to paint in offscreen mode (just to buffer). What do I need set to do this?

Thank you.