Skip navigation.
Home
The QNX Community Portal

View topic - How to make a snapshot of the screen/window at runtime?

How to make a snapshot of the screen/window at runtime?

Isn't the name clear?

How to make a snapshot of the screen/window at runtime?

Postby meg » Fri Jun 22, 2007 8:06 am

Hello,

I'd like to make a snapshot of the sreen/window/area at run time form my PhAB C apllication. I bulid an HMI and I want to add new integrated functionality for users to make a screenshot of current data on the screen. As I found it was easy to do it in QNX 4.25 with snapshot command (with relevant options) e.g.:

snapshot -A 100*100 -o 50*50 -p "BMP Spool File" -f /src/photon/apps/print1.bmp

But in QNX 6.3 version it doesn't work by this way.

Could you give me a tips how to do it by code, please?

Thans, Meg
meg
Active Member
 
Posts: 10
Joined: Mon May 29, 2006 6:53 am

RE: How to make a snapshot of the screen/window at runtime?

Postby micro » Fri Jun 22, 2007 10:17 am

The parameters given to snapshot are just for the GUI-App Snapshot, so not a direct screenshot.
I don´t think there is anythink like the old console-driven-snapshot possible, unless you write your
own shot-app
micro
Senior Member
 
Posts: 458
Joined: Thu Jul 22, 2004 8:41 pm

Postby meg » Fri Jun 22, 2007 10:53 am

OK, but could you give me some principle idea how on it?
meg
Active Member
 
Posts: 10
Joined: Mon May 29, 2006 6:53 am

Postby micro » Fri Jun 22, 2007 1:14 pm

I think you would need to open a memoryContext and Copy your current DC into it, where the DC is the MAIN-Screen

I do right now do not have the time to check this, but i will try this soon i guess :)
micro
Senior Member
 
Posts: 458
Joined: Thu Jul 22, 2004 8:41 pm

Postby meg » Mon Jun 25, 2007 11:34 am

For all others...

I found a good example here:

http://www.qnx.com/developers/articles/ ... 293_2.html

I works nice!!!
meg
Active Member
 
Posts: 10
Joined: Mon May 29, 2006 6:53 am

Postby micro » Mon Jun 25, 2007 1:08 pm

thx a lot, so i do not have to try that long now :)
micro
Senior Member
 
Posts: 458
Joined: Thu Jul 22, 2004 8:41 pm

Postby ke » Fri Sep 28, 2007 2:31 pm

Any know, how to draw widget to memory context?
ke
New Member
 
Posts: 2
Joined: Thu Aug 04, 2005 12:10 pm

Postby wwx » Mon Oct 13, 2008 2:22 am

The memory context has a property image which has the same structure of image. Use that to decode the pointer to unsigned char of image data.
wwx
New Member
 
Posts: 2
Joined: Wed Oct 08, 2008 2:14 am


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 2 guests