A "screen dump" is also known as a "screen shot". It is a copy of the output to the screen.
Screen dumps are important documentation. When inspecting the source code of a program, it helps to better understand the program if the inspector can see what the output looks like.
There are at least three types of output that we may want to copy. You use different methods capture a screen shot for each type of output.
Check out the following example of a program with a screen dump.
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
cout << "This is the output that we want in the screen dump.";
cout << endl << endl;
system("PAUSE");
return 0;
}
/* Screen Dump
This is the output that we want in the screen dump.
Press any key to continue . . .
*/
|
While text output to the clipboard copies to a text editor, graphical output must be copied to software that can handle graphics output. Notepad cannot handle graphics output but Wordpad can!
Do not automatically copy graphical output to the editor containing your source code because it will contain a white image on a black background. This will consume gobs of toner when you print the source code containing the graphical screen dump. An extra step is needed when copying a graphical screen dump to a source code listing.
After copying the graphical image to the clipboard but before further copying the clipboard to the source code, convert the graphical image to a "negative image" in a paint program such as Paint Shop Pro.
For example; after the graphical image is copied to the clip board:
You may now print the source code together with it's accompanying graphical screen dump.
Check out the following example of a graphical program with a screen dump.
#include <winbgim.h>
#include <cstdlib>
int main()
{
// Set the graphics mode
initwindow(400,300);
// Draw the two-headed arrow
moveto(30, 30);
lineto(180, 30);
moveto(30, 30);
lineto(60, 0);
moveto(30, 30);
lineto(60, 60);
moveto(180, 30);
lineto(150, 0);
moveto(180, 30);
lineto(150, 60);
// Draw the two-tailed arrow
moveto(30, 100);
lineto(180, 100);
moveto(30, 100);
lineto(0, 70);
moveto(30, 100);
lineto(0, 130);
moveto(180, 100);
lineto(210, 70);
moveto(180, 100);
lineto(210, 130);
// Label the drawing
moveto(0, 250);
outtext("The Muller-Lyer illusion");
// Pause for a key to be pressed
moveto(200, 300);
outtext("Strike any key to continue");
while(!kbhit());
// Close the graphics mode
closegraph();
return (0);
} // end main
/* Screen Dump
|
Simultaneously pressing [Alt][PrtScn] will copy the Dialog Box to the clipboard from whence you can paste it just below your source code. You must paste it in an application such as a wordprocessor that accepts graphical images.
|
![]() csgate@donaldson.org |
|