Hello,
how to export image or take a snapshot of QSurface Widget?
I'm using QSurface example.
Kking
Edit: i have found a solution:
Qt Code:
To copy to clipboard, switch view to plain text mode
Hello,
how to export image or take a snapshot of QSurface Widget?
I'm using QSurface example.
Kking
Edit: i have found a solution:
Qt Code:
To copy to clipboard, switch view to plain text mode
Last edited by kkingstoun; 20th February 2017 at 20:01.
QPixmap::grabWindow() is an obsolete method which should not be used in new code. It could be removed in a future Qt release.
If your surface is an OpenGL window, then you can use QOpenGLWindow::grabFrameBuffer() to get a QImage. If it is a QML scene window, use QQuickWindow::grabWindow(). If it is a widget, use QWidget::grab() or QWidget::render().
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks