[Qt-interest] Convert HTML page in QWebFrame to Image

wim.delvaux at adaptiveplanet.com wim.delvaux at adaptiveplanet.com
Mon Mar 16 04:46:43 CET 2009


I want to convert the content of a QWebFrame to an image

I do :

QWebFrame  * WF = TheHTML->page()->mainFrame();
QSize CS = WF->contentsSize();
QImage Img( CS, QImage::Format_RGB32 );
QPainter P( &Img );
WF->render( &P, QRegion( 0, 0, CS.width(), CS.height() ) );

However, the contentsSize() method does not return the size of the entire page 
but the size of the visible part of that frame as rendered in the 
application.

Is there a way to grab the *entire* content ? I.e. also the part NOT visible ?

Thx
W



More information about the Qt-interest-old mailing list