Click here to Skip to main content
13,597,797 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi 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 1:35am
Updated 3-Mar-12 2: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.
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 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.

Mohibur Rashid 3-Mar-12 19:41pm
its a good answer though, but i guess, windows.h is not an option for op
Thank you, but why not an option?
Mohibur Rashid 3-Mar-12 21:24pm
cause i can guess he is using tc3.0, just a guess
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.
Mohibur Rashid 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.
That I remember. There was a text mode (not exactly console but random access), and BGI; two separate modes. BGI was extremely poor thing.
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 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 !!!!!!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.180621.3 | Last Updated 24 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

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