[webkit-qt] Image capture of the contents of a QML WebView

Olivier Tilloy olivier at tilloy.net
Thu Jul 18 01:22:06 PDT 2013


Alberto Mardegan a écrit :
> On 07/15/2013 09:40 AM, Olivier Tilloy wrote:
>> An update on my work on generating thumbnails for web pages:
>>
>> I solved my problem by writing a custom QQuickItem that, when updated,
>> renders the webview into a FBO and saves the contents of that FBO to a
>> file. The WebviewThumbnailer (as I named it) is not updated by default,
>> it has to be requested explicitly. I’ve implemented it in the Ubuntu
>> Touch web browser. For those interested, see the code here:
>
> I recently found out about this:
> http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-shadereffectsource.html
>
> It doesn't save the image to a file, but it might still help you.

Yes, I initially toyed with the ShaderEffectSource. However, as you’re 
pointing out, there is no way to save the image to a file, hence my 
custom solution, which essentially is a very simplified version of 
ShaderEffectSource that renders the source item to an FBO and dumps the 
contents of this FBO to an image file when requested.


More information about the webkit-qt mailing list