Re: QGLWidget
Phlip <[email protected]>
| Newsgroups | gmane.games.devel.opengl |
|---|---|
| Organization | Fat City Network Services, San Diego, California |
| Message-ID | <[email protected]> |
Zein Salah wrote:
> I am rendering into a QGLWidget. Is there actually a
> way to same the contents of
> this qglwidget into an image?
That happened to be a Qt question:
static void
nabFrameBuffer(QString caseName)
{
QPixmap pix =
QPixmap::grabWindow(pMainWindow->winId());
QImage img = pix.convertToImage();
QString fileName = caseName + ".jpg";
img.save(fileName,"JPEG",100);
}
Because I'm pernicious and pedantic, that grabbed the
entire client window, not just the QGLWidget. To only
grab the image, I suspect you start like this:
QGLWidget * c1;
QImage img = c1->grabFrameBuffer();
To be even more pedantic, I use an external window
capture program to grab the entire window, borders and
all. That's to create a gallery of sample outputs,
like this:
http://www.c2.com/cgi/wiki?BroadbandFeedback
Phlip
http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-----
FAQ and OpenGL Resources at:
http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
--
Author: Phlip
INET: [email protected]
Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).