How do I use QPixmap::grabWindow with offscreen (QScrollArea) regions ?
How can I grab an entire window that is inside a scrollarea ?
My content inside it have more than 1600x1200.
The content is a flash app and I can scroll it, but want to grab the entire content to save it.
And QPixmap::grabWidget doesn't work too.
Re: How do I use QPixmap::grabWindow with offscreen (QScrollArea) regions ?
See QWidget::render(). There is also an example for your situation!
Re: How do I use QPixmap::grabWindow with offscreen (QScrollArea) regions ?
I've tried it yesterday when I found it, but, it don't capture the Flash content in the WebView.
Code:
void Standalone::screenShot_VirtualScreen()
{
QImage img
(ui
->webView
->page
()->mainFrame
()->contentsSize
(),
QImage::Format_ARGB32_Premultiplied);
img.fill(Qt::transparent);
painter.
setRenderHint(QPainter::Antialiasing,
true);
painter.
setRenderHint(QPainter::TextAntialiasing,
true);
painter.
setRenderHint(QPainter::SmoothPixmapTransform,
true);
ui->webView->render(&painter);
painter.end();
img.save(screenShotPath(), "PNG");
}
It's only give me a "empty" (background-color) image, and not the content.