Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, August 2006
qglwidget and printing


Message 1 in thread

Hi,
does anyone of you have an idea how to print the contents of opengl 
widget? I suppose that it is not so straightforward as in the case of 
standard canvas. Or am I wrong?
thx
d.

--
 [ signature omitted ] 

Message 2 in thread

"dejfson" <dejfson@xxxxxxxxxxx> wrote in message 
news:44CE8318.5000403@xxxxxxxxxxxxxx
> Hi,
> does anyone of you have an idea how to print the contents of opengl 
> widget? I suppose that it is not so straightforward as in the case of 
> standard canvas. Or am I wrong?
> thx
> d.

Get the contents using either QGLWidget::renderPixmap or grabFrameBuffer, 
and print them:


http://doc.trolltech.com/4.1/qglwidget.html#renderPixmap
http://doc.trolltech.com/4.1/qglwidget.html#grabFrameBuffer


renderPixmap is usually better for this purpose, as you can this way 
generate a high resolution image.

Volker


--
 [ signature omitted ]