<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=074544016-15072008><FONT face=Arial 
color=#0000ff size=2>A search of the mailing list archives will answer this 
often asked question</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=074544016-15072008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=074544016-15072008><FONT face=Arial 
color=#0000ff size=2>you need a valid graphics context to do this which is 
typically available in the draw process, t</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> osg-users-bounces@lists.openscenegraph.org 
[mailto:osg-users-bounces@lists.openscenegraph.org] <B>On Behalf Of </B>Carlos 
Sanches<BR><B>Sent:</B> Tuesday, July 15, 2008 12:23 PM<BR><B>To:</B> 
OpenSceneGraph Users<BR><B>Subject:</B> Re: [osg-users] How to take a picture of 
my scene?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr><BR>I continue to render a black screen :( <BR>How do I have to use 
de postdrawcallback ?<BR>I m using this code:<BR><BR> bool 
myKeyboardEventHandler::handle(const osgGA::GUIEventAdapter& 
ea,osgGA::GUIActionAdapter& aa)<BR> {<BR>      
switch(ea.getEventType())<BR>       
{<BR>       
case(osgGA::GUIEventAdapter::KEYDOWN):<BR>          
{<BR>               
switch(ea.getKey())<BR>               
{<BR>                 
case 
'a':<BR>                
    
<BR>                
     image->readPixels(0,0,200,200, 
GL_RGB,GL_UNSIGNED_BYTE);<BR>                
    
 osgDB::writeImageFile(*image,"capture.bmp");<BR>                
       
<BR>                
     return 
false;<BR>                 
break;<BR>            
<BR>                 
...<BR><BR><BR><BR><BR></DIV></BODY></HTML>