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

Martin Leutelt Martin.Leutelt at basyskom.com
Thu May 23 00:20:18 PDT 2013


Hi Olivier, 
 
I guess that what you want to do could be achieved in several ways, depending on
which version of Qt/QML you're using.
Assuming you're using QtQuick1:
- write a QML-Plugin in which you create a custom painter that writes to an
image, then pass that custom painter to
the paint method of the item you want to take the screenshot of
- use a ShaderEffectSource item in QML and set the target without doing live
updates
If you're using QtQuick2:
- also use ShaderEffectSource
- write a QML-plugin again, grab the whole screen of your application an cut out
the area of the item you're interested in by using the coordinates that you
passed to the plugin
 
I think that the solution using shaders would fit your purpose fine, unless you
really need to have the 'screenshots' as real files. Hope that helps.
 
Regards,
Martin
 

On May 22, 2013 at 7:29 PM Olivier Tilloy <olivier at tilloy.net> wrote:

> I’m interested in capturing an image of the contents rendered into a QML
> WebView. Ideally, from QML itself. If not directly possible, writing
> some C++ to do that is an option. My question is: how would I go about
> doing this?
>
> My use case is caching and displaying thumbnails of pages previously
> visited (browser history), and currently open tabs.
>
> Help appreciated. Thanks!
>
>   Olivier
> _______________________________________________
> webkit-qt mailing list
> webkit-qt at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-qt
--
Martin Leutelt
Software Engineer

basysKom GmbH
Robert-Bosch-Str. 7 | 64293 Darmstadt | Germany
Tel: +49 6151 870 589 -0 | Fax: -199
martin.leutelt at basyskom.com  |www.basyskom.com

Handelsregister: Darmstadt HRB 9352
Geschaeftsfuehrung: Dr.-Ing. Eva Brucherseifer, Heike Ziegler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20130523/629e59f8/attachment.html>


More information about the webkit-qt mailing list