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

2014-02-14 Thread Raine Mäkeläinen
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

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

2014-02-14 Thread itviewer
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

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

2014-02-14 Thread itviewer
Hi  Storbjörk ,
Thank you very much,you are right!
By the way,in the latest “screenshot”,if choose “Use PNG”option,it will also 
block the UI!
Therefore, we should use  .jpg instead of .png!
thanks again.




ma xinjun

发件人: Andreas Storbjörk
发送时间: 2014-02-14 23:51
收件人: Sailfish OS Developers
主题: Re: [SailfishDevel]Please help me, how to get the screen capture without 
block UI
Hi,

You could try to save as .jpg instead and see if that speeds it up.

On 14.2.2014 09:19, itviewer wrote:

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___
SailfishOS.org Devel mailing list