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-boun...@lists.sailfishos.org 
[devel-boun...@lists.sailfishos.org] käyttäjän itviewer [itvie...@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
_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to