Click here to Skip to main content
11,920,641 members (60,171 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++
I am performing the translation,rotation techniques on line drawn in a c++ program.Also using a graphics package to draw the line
But i cannot take the screen shot of the output that comes on console screen
I tried all possible combinations and also alt+printscreen,but its not working
Plzease help me...
Posted 3-Mar-12 2:35am
Edited 3-Mar-12 3:24am
Richard MacCutchan 3-Mar-12 8:27am
What does "it's not working" mean? Please provide full details of what your program is trying to do and what results you get. I just tried alt+printscreen on a console program and it worked fine.
SAKryukov 3-Mar-12 15:21pm
Of course. I answered how to do it programmatically, according to a title of the question, please see.

If OP's problem is using Alt+PrnScr, that would be off-topic...
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

You can use ALT + ENTER from output window of C ++ then you will come out of full screen.
After that you can use "Printscreen" and then paste in mspaint.

It will work !!!!!!
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

may be you can use getpixel function and create a bitmap and save to disk. it is not that hard.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Print screen Alt+PrnScr always works on console applications. You are doing something wrong; or your OS is broken.

Basically, you do it through getimage(int left, int top, int right, int bottom, void *bitmap), please see:[^].

Additional problem is how to get the extents of the console window. Here you need to use include <windows.h> as well.

In particular, you can assume that the screenshot code is being executed or you can get screen shot of all windows on the desktop, or use some other selection criteria. You will need some of the following Windows API functions:[^],[^],[^],[^].

The last one GetWindowRect ultimately gives you the size/position parameters you need for a call to getimage.

johny10151981 3-Mar-12 19:41pm
its a good answer though, but i guess, windows.h is not an option for op
SAKryukov 3-Mar-12 19:47pm
Thank you, but why not an option?
johny10151981 3-Mar-12 21:24pm
cause i can guess he is using tc3.0, just a guess
SAKryukov 4-Mar-12 4:12am
Really? How do you know (I used Borland C++ too many years ago)? What, windows.h is not available because there is no Windows? Anyway, if something is run under Windows and Windows API is not available, what development is possible?

Oh, I got it. Probably you mean that Windows only accessible indirectly via WinBGIM which simulates obsolete Borland Program Interface (BGI) and nothing else. That would be sad. Hard to do development with so deeply obsolete stuff.
johny10151981 4-Mar-12 6:38am
During my study I used Turbo C++ 3.0, it's console based. i don't recall having windows.h, it have dos.h though.
SAKryukov 4-Mar-12 13:03pm
That I remember. There was a text mode (not exactly console but random access), and BGI; two separate modes. BGI was extremely poor thing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 548
1 Dave Kreskowiak 245
2 phil.o 170
3 KrunalRohit 134
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,530
2 Sergey Alexandrovich Kryukov 3,203
3 George Jonsson 2,815
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web02 | 2.8.151120.1 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100