Screen shots

hi i am looking to obtain screen shots of my outputs for certain programs i have written.
is there anyway to get this done within the code itself (i’m not too keen on using printscreen).
i’m looking for some opengl command that wll create a bitmap or a jpeg file of watever is on display at that moment.
can anyone help me out???
thanks
vivek

look at glReadPixels this will give you the raw pixel data. From there it is up to you to save it as some sort of image file.