Category : Files from Magazines
Archive   : MAR91.ZIP
Filename : 2N03006A

 
Output of file : 2N03006A contained in archive : MAR91.ZIP
/*
* Listing 1. Initialize the graphics library, draw a
* figure on the screen, and output it to a printer.
* The print_screen() routines are in other listings.
*/
#include
#include
#include
#include
#include

/* prototypes
*/
void print_screen( void );

/* global variables
*/
int x_max, y_max; /* largest X, Y coordinate available */
int print_fh; /* file handle for printer output */


void main( void )
{
int g_driver, g_mode;

/* Open the printer for output, in binary mode.
*/
if ((print_fh = open("PRN", O_WRONLY|O_BINARY)) == -1)
{
printf("Can't open printer!\n");
exit(1);
}

/* Let Turbo C figure out what graphics adapter we're
* using, and initialize it.
*/
detectgraph(&g_driver, &g_mode);
initgraph(&g_driver, &g_mode, "C:\\TC");

/* Get the maximum XY coordinates of this adapter.
*/
x_max = getmaxx();
y_max = getmaxy();

/* Draw a simple figure for testing: a rectangular
* border, a diagonal line, and a circle in the middle.
*/
rectangle(0, 0, x_max, y_max);
line(0, 0, x_max, y_max);
circle(x_max / 2, y_max / 2, y_max / 3);

/* Do the printout (see other listings).
*/
print_screen();

/* Put the screen in text mode, close the printer, and exit.
*/
closegraph();
close(print_fh);
exit(0);
}


  3 Responses to “Category : Files from Magazines
Archive   : MAR91.ZIP
Filename : 2N03006A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/