[SailfishDevel] Please help me, how to get the screen capture without block UI

itviewer itviewer at jolladev.net
Fri Feb 14 11:05:20 UTC 2014


thanks,But I want capture all the desktop screen




ma xinun

发件人: Raine Mäkeläinen
发送时间: 2014-02-14 17:25
收件人: Sailfish OS Developers
主题: Re: [SailfishDevel]Please help me, how to get the screen capture without block UI
Hi,

If you want to capture something on your application side, you can grab whole window through QQuickItem. This part is blocking but you can do capture manipulations in async manner quite simple by using QFutureWatcher.

Like:

void ScreenShow::screenShot(QQuickItem *item)
{
    if (item && item->window()) {
        // Blocks for a short moment
        QImage image = item->window()->grabWindow();
        // Could be done in later
        image.save("/home/nemo/Pictures/iface.png")
    }
}

-Raine





Lähettäjä: devel-bounces at lists.sailfishos.org [devel-bounces at lists.sailfishos.org] käyttäjän itviewer [itviewer at jolladev.net] puolesta
Lähetetty: 14. helmikuuta 2014 9:19
Vastaanottaja: devel
Aihe: [SailfishDevel] Please help me, how to get the screen capture without block UI


Dear ,
attachment is all my code,and I have been tried many times
but it still block the UI(about 3 seconds)  when the program starts ( or after click  the label“Hello Sailors”)
While, it seems that there is no such blocking when using the harbor store app "screenshot".

Very grateful,thanks everybody。



ma xinjun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140214/956787e5/attachment.html>


More information about the Devel mailing list