Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,430 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,306 people online right now. Registration is fast and FREE... Join Now!




Capturing Graphical screen

 
Reply to this topicStart new topic

Capturing Graphical screen

rockey
2 Feb, 2008 - 03:35 AM
Post #1

D.I.C Head
**

Joined: 2 Jan, 2008
Posts: 57


My Contributions
Hello Everybody,

My question is that how can I capture the graphical screen which I created in C. I make my project using graphics command and i want this program screen shot but I dont know it's procedure. Can any one know how to capture graphical screen.

When I create program without using graphical command i can capture the output screen using PRINTSCREEN keyword in the keyboard. But when I converted it into graphics mode. It doesn't work

So Please tell me how can I capture or print the graphical output screen.
If you know any keyword which capture the graphical mode so tell me as far as possible.

I will be very thankful to you.

Regards:
Rockey
User is offlineProfile CardPM
+Quote Post

GWatt
RE: Capturing Graphical Screen
2 Feb, 2008 - 07:14 AM
Post #2

human inside
Group Icon

Joined: 1 Dec, 2005
Posts: 2,356



Thanked: 31 times
Dream Kudos: 500
My Contributions
So, do you need a screenshot of your program that's written in C, or do you want to write code into your program that will take the screenshot for you?
User is offlineProfile CardPM
+Quote Post

rockey
RE: Capturing Graphical Screen
2 Feb, 2008 - 08:01 AM
Post #3

D.I.C Head
**

Joined: 2 Jan, 2008
Posts: 57


My Contributions
QUOTE(GWatt @ 2 Feb, 2008 - 08:14 AM) *

So, do you need a screenshot of your program that's written in C, or do you want to write code into your program that will take the screenshot for you?

Well I completed my project yesterday, know i want the output picture of my project but i don't know how to capture it.

Printscreen key is disable in graphical mode. So You know any keyword to capture the graphical output window so please pass it to me.




User is offlineProfile CardPM
+Quote Post

davegeek
RE: Capturing Graphical Screen
2 Feb, 2008 - 01:41 PM
Post #4

D.I.C Head
Group Icon

Joined: 30 Jan, 2008
Posts: 81



Thanked: 2 times
My Contributions
Hi there!

I am not a developer, but from the automation testing point of view, were I in your shoes, I would put some snippet that will call some external program like SnagIt (or use GIMP) which in turn will make a screen dump.

Lemeno if this does not help, I will think about it more.
User is offlineProfile CardPM
+Quote Post

rockey
RE: Capturing Graphical Screen
6 Feb, 2008 - 04:56 AM
Post #5

D.I.C Head
**

Joined: 2 Jan, 2008
Posts: 57


My Contributions
There is nobody which give the answer of my question that how to capture graphical screen in C Langauge???
User is offlineProfile CardPM
+Quote Post

KYA
RE: Capturing Graphical Screen
6 Feb, 2008 - 06:23 AM
Post #6

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,850



Thanked: 159 times
Dream Kudos: 1375
My Contributions
QUOTE(rockey @ 6 Feb, 2008 - 06:56 AM) *

There is nobody which give the answer of my question that how to capture graphical screen in C Langauge???


I know you can do this with C++ not necessaarily with C as I haven't tried it, but:

What about creating a context that covers the whole screen, then blit it to another device context for saving or printing?

edit: Here's a snippet along that thought process:

CODE

CWindowDC dc(NULL);   // use NULL to get whole screen
CDC memdc;
... // create, initialize memdc
memdc.BitBlt(..., &dc); // copy screen contents


--KYA

This post has been edited by KYA: 6 Feb, 2008 - 06:25 AM
User is online!Profile CardPM
+Quote Post

rockey
RE: Capturing Graphical Screen
6 Feb, 2008 - 06:39 AM
Post #7

D.I.C Head
**

Joined: 2 Jan, 2008
Posts: 57


My Contributions
Ok.. Thxx Buddy!!
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 11:43AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month