diff options
Diffstat (limited to 'src/websnap.cpp')
-rw-r--r-- | src/websnap.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/websnap.cpp b/src/websnap.cpp index ec537b32..c669dee0 100644 --- a/src/websnap.cpp +++ b/src/websnap.cpp @@ -58,7 +58,6 @@ WebSnap::WebSnap(const QString &url, const QString &pos) void WebSnap::load() { - kDebug() << "loading.."; m_page.mainFrame()->load( QUrl(m_url) ); } @@ -72,17 +71,16 @@ void WebSnap::saveResult(bool ok) return; } - // find proper size, we stick to sensible aspect ratio + // find proper image size and later resize it.. QSize size = m_page.mainFrame()->contentsSize(); - size.setHeight(size.width() * HEIGHT / WIDTH ); - + // create the target surface - m_image = QPixmap(WIDTH, HEIGHT); + m_image = QPixmap( size ); m_image.fill(Qt::transparent); // render and rescale QPainter p(&m_image); - m_page.setViewportSize(m_page.mainFrame()->contentsSize()); + m_page.setViewportSize( size ); m_page.mainFrame()->render(&p); p.end(); m_image = m_image.scaled(WIDTH, HEIGHT, Qt::KeepAspectRatioByExpanding); |