IoIo programming languageScreenshot- February 27, 2008 Some sample code for taking a screenshot in an OpenGL app: First, let us add a Image method to help: Image grabScreen := method( data := Sequence clone width := glutGet(GLUT_WINDOW_WIDTH) height := glutGet(GLUT_WINDOW_HEIGHT) glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data) self setDataWidthHeightComponentCount(data, width, height, 4) self flipY ) Now we can use it (within a running GL application): Image clone grabScreen.http://www.iolanguage.com/blog/blog.cgi?do=item&id=109 |