eric_vi
16th September 2010, 18:47
i am trying to render a web page into a file
according to the documentation... you need to set the viewport size with the page.MainFrame() size...
my problem is that if the url is an image document such as a simple jpg or png there is no such thing and page.MainFrame()->contentsSize() is (0,0)!
page.setViewportSize(page.mainFrame()->contentsSize());
QImage image(page.viewportSize(), QImage::Format_ARGB32);
QPainter painter(&image);
so the question is... if i have an url to a picture that is displayed by the renderer without any mainframe around, how can i collect the pixel size of this image document? The QTWebView displays the pixel size in the title so there should be a way to get this info
Thank you for your help
according to the documentation... you need to set the viewport size with the page.MainFrame() size...
my problem is that if the url is an image document such as a simple jpg or png there is no such thing and page.MainFrame()->contentsSize() is (0,0)!
page.setViewportSize(page.mainFrame()->contentsSize());
QImage image(page.viewportSize(), QImage::Format_ARGB32);
QPainter painter(&image);
so the question is... if i have an url to a picture that is displayed by the renderer without any mainframe around, how can i collect the pixel size of this image document? The QTWebView displays the pixel size in the title so there should be a way to get this info
Thank you for your help