Example #1
0
int main( int argc, char *argv[] )
//================================

//  Initialize graphics library and presentation graphics
//  system and then display several sample charts.

{
    int                 mode;

    if( argc == 2 ) {
        mode = atoi( argv[ 1 ] );
    } else {
        mode = _MAXRESMODE;
    }
    if( _setvideomode( mode ) == 0 ) {
        puts( "Cannot initialize video mode" );
        return( 1 );
    }
    _getvideoconfig( &vconfig );
    xmax = vconfig.numxpixels;
    ymax = vconfig.numypixels;
    xmid = xmax / 2;
    ymid = ymax / 2;
    _pg_initchart();
    simple_chart();
    press_key();
    _clearscreen( _GCLEARSCREEN );
    more_charts();
    press_key();
    _clearscreen( _GCLEARSCREEN );
    scatter_charts();
    press_key();
    _setvideomode( _DEFAULTMODE );
    return( 0 );
}
Example #2
0
void main(void)
{
    int x1, y1, x2, y2, color, index;
    
    _setvideomode(_VRES16COLOR);
    
    //draw 10,000 points
    for(index = 0; index < 1000; index++)
    {
        x1 = rand() % 640;
        y1 = rand() % 480;
        x2 = rand() % 640;
        y2 = rand() % 480;
        
        color = rand() % 16;
        
        _setcolor(color);
        _moveto(x1,y1);
        _lineto(x2,y2);
    }
    
    while(!kbhit()) {}
    
    _setvideomode(_DEFAULTMODE);
}
Example #3
0
main()
{
    _setvideomode( _VRES16COLOR );
    _polygon( _GBORDER, 5, points );
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #4
0
void main()
{   // initialize an organism, and then begin evolution
    // initialize video mode
    _setvideomode(_MAXRESMODE);
    _getvideoconfig(&vc);

    // set the special memory handler
    _set_new_handler(free_memory);

    // seed random number generator
    srand((unsigned)time(NULL));

    //CFile treeFile;
    //if (treeFile.Open("TREE.DAT", CFile::modeRead))
    //{   // file exists, so deserialize
    //CArchive treeArc(&treeFile, CArchive::load);
    //FoundingFather.Serialize(treeArc);
    //treeArc.Close();
    //treeFile.Close();
    //};  // if

    //FoundingFather.Dump(afxDump);
    FoundingFather.evolve();

    //if (treeFile.Open("TREE.DAT", CFile::modeCreate | CFile::modeWrite))
    //{   // now serialize the family tree
    //CArchive treeArc(&treeFile, CArchive::store);
    //FoundingFather.Serialize(treeArc);
    //treeArc.Close();
    //treeFile.Close();
    //};  // if

    _clearscreen(_GCLEARSCREEN);
    _setvideomode(_TEXTC80);
};  // void main()
Example #5
0
main()
{
    _setvideomode( _VRES16COLOR );
    _grtext( 200, 100, " WATCOM" );
    _grtext( 200, 200, "Graphics" );
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #6
0
int main( const int argc, const char **argv)
{
   int function = atoi( argv[1]), i;
   char buff[200];
   FILE *ifile = fopen( "loneos.phot", "rb");
   double limits[12] = { -.4, 3.9, -.4, 2.,        /* V-I to B-V */
                         -.5, 4.2, -.4, 2.1,       /* V-I to V-R */
                         -.3, 2.,  -.4, 2.2 };     /* V-R to B-V */
   double *lim = limits + function * 4;
   int xcolumns[3] = { 75, 75, 69 };
   int ycolumns[3] = { 63, 69, 63 };

   _setvideomode( _VRES16COLOR);
   _setcolor( 2);
   for( i = 0; i < 640; i++)
      {
      double ocolor, icolor = lim[0] + (lim[1] - lim[0]) * (double)i / 640.;

      if( function == 0)
         ocolor = v_minus_i_to_b_minus_v( icolor);
      else if( function == 1)
         ocolor = v_minus_i_to_v_minus_r( icolor);
      else
         ocolor = v_minus_r_to_b_minus_v( icolor);
      _setpixel( (short)i, (short)( 480. * (ocolor-lim[3]) / (lim[2]-lim[3])));
      }

   _setcolor( 3);
   while( fgets( buff, sizeof( buff), ifile))
      {
      if( buff[xcolumns[function]] == '.' && buff[ycolumns[function]] == '.')
         {
         double icolor = atof( buff + xcolumns[function] - 2);
         double ocolor = atof( buff + ycolumns[function] - 2);
         int xpixel = (int)( 640. * (icolor-lim[0]) / (lim[1]-lim[0]));
         int ypixel = (int)( 480. * (ocolor-lim[3]) / (lim[2]-lim[3]));
         short ix, iy;
         short deltas[9 * 2] = { 0,0, 1,0, 0,1, -1,0, 0,-1,
                        1,1, 1,-1, -1,-1, -1,1 };

         for( i = 0; i < 18; i += 2)
            {
            ix = (short)( xpixel + deltas[i]);
            iy = (short)( ypixel + deltas[i + 1]);
            if( !_getpixel( ix, iy))
               i = 99;
            }
         if( i != 18)
            _setpixel( ix, iy);
         }
      buff[xcolumns[function]] = buff[ycolumns[function]] = ' ';
      }
   fclose( ifile);

   getch( );
   _setvideomode( _DEFAULTMODE);
   return( 0);
}
Example #7
0
main()
{
    _setvideomode( _VRES16COLOR );
    _moveto( 100, 100 );
    _lineto( 540, 100 );
    _lineto( 320, 380 );
    _lineto( 100, 100 );
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #8
0
main()
{
    struct rccoord old_pos;

    _setvideomode( _TEXTC80 );
    old_pos = _gettextposition();
    _settextposition( 10, 40 );
    _outtext( "WATCOM Graphics" );
    _settextposition( old_pos.row, old_pos.col );
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #9
0
main()
{
    chartenv env;

    _setvideomode( _VRES16COLOR );
    _pg_initchart();
    _pg_defaultchart( &env,
		      _PG_COLUMNCHART, _PG_PLAINBARS );
    strcpy( env.maintitle.title, "Column Chart" );
    _pg_chart( &env, categories, values, NUM_VALUES );
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #10
0
main()
{
    int x, y;

    _setvideomode( _VRES16COLOR );
    while( _grstatus() == _GROK ) {
	x = rand() % 700;
	y = rand() % 500;
	_setpixel( x, y );
    }
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #11
0
main()
{
    chartenv env;

    _setvideomode( _VRES16COLOR );
    _pg_initchart();
    _pg_defaultchart( &env,
		      _PG_PIECHART, _PG_NOPERCENT );
    strcpy( env.maintitle.title, "Pie Chart" );
    _pg_chartpie( &env, categories,
		  values, explode, NUM_VALUES );
    getch();
    _setvideomode( _DEFAULTMODE );
}
/* Simulator initialisieren */
void Init_Simulator(void)
{
   char za;

   /* Variabeln initialisieren */
   /* Spritevariabeln:unmoegliche Werte=1x setzten */
   old_tool=99;

   inkrementell=1;
   trace=0;
   menue=0;
   xcorr=0;
   zcorr=0;
   if (!_setvideomode(_HRESBW))
    {
      printf("Grafikerror! CNCSIM Ende\n");
      exit(1);
    }

   ip=0;		 /* Instruction Pointer */
   sp=0;		 /* Stack Pointer */
   for (za=0;za<6;za++)  /* Stack fuer Unterprogramme */
       stack[za]=null;

   tool=1;  /* Nullpunkt mit Referenzwerkzeug anfahren */
}
Example #13
0
void LT_GraphicsClose (void)
{
    if (bGraphicsModeWasChanged)
    {
        _setvideomode (_DEFAULTMODE);
        bGraphicsModeWasChanged = FALSE;
    }
}
Example #14
0
void LT_GraphicsOpen (void)
{
    if (! bGraphicsModeWasChanged)
    {
        bGraphicsModeWasChanged = TRUE;
        _setvideomode (_VRES16COLOR);
    }
}
Example #15
0
main()
{
    int i;
    short r1, c1, r2, c2;
    char buf[ 80 ];

    _setvideomode( _TEXTC80 );
    _gettextwindow( &r1, &c1, &r2, &c2 );
    _settextwindow( 5, 20, 20, 40 );
    for( i = 1; i <= 20; ++i ) {
	sprintf( buf, "Line %d\n", i );
	_outtext( buf );
    }
    getch();
    _settextwindow( r1, c1, r2, c2 );
    _setvideomode( _DEFAULTMODE );
}
Example #16
0
static int InitScreen( void )
/*===========================

    This routine selects the best video mode for a given adapter. */

{
    int                 mode;

    _getvideoconfig( &VC );
    switch( VC.adapter ) {
    case _VGA :
        mode = _VRES16COLOR;
    break;
    case _SVGA :
    mode = _SVRES256COLOR;
        break;
    case _MCGA :
        mode = _MRES256COLOR;
        break;
    case _EGA :
        if( VC.monitor == _MONO ) {
            mode = _ERESNOCOLOR;
        } else {
            mode = _ERESCOLOR;
        }
        break;
    case _CGA :
        mode = _MRES4COLOR;
        break;
    case _HERCULES :
        mode = _HERCMONO;
        break;
    default :
        return( 0 );          /* report insufficient hardware */
    }

    if( _setvideomode( mode ) == 0 ) {
        return( 0 );
    }
    mess_with_stride();
    _getvideoconfig( &VC );
    if( VC.numcolors < 4 ) {
        TextColour = 1;
        TextColour2 = 1;
        BorderColour = 1;
    } else {
        TextColour = 1;
        TextColour2 = 3;
        BorderColour = 2;
    }
    if( VC.adapter >= _MCGA ) {
        /* set up new colours */
        _remappalette( TextColour, 0x3f0000 );  /* light blue */
        _remappalette( TextColour2, 0x3f0000 ); /* light blue */
        _remappalette( BorderColour, _BLACK );  /* black      */
    }
    return( 1 );
}
Example #17
0
main()
{
    int i;
    char buf[ 80 ];

    _setvideomode( _TEXTC80 );
    _settextwindow( 5, 20, 20, 40 );
    for( i = 1; i <= 10; ++i ) {
	sprintf( buf, "Line %d\n", i );
	_outtext( buf );
    }
    getch();
    _scrolltextwindow( _GSCROLLDOWN );
    getch();
    _scrolltextwindow( _GSCROLLUP );
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #18
0
main()
{
    chartenv env;
    char old_def[ 8 ];

    _setvideomode( _VRES16COLOR );
    _pg_initchart();
    _pg_defaultchart( &env,
                      _PG_SCATTERCHART, _PG_POINTANDLINE );
    strcpy( env.maintitle.title, "Scatter Chart" );
    /* change asterisk character to diamond */
    _pg_getchardef( '*', old_def );
    _pg_setchardef( '*', diamond );
    _pg_chartscatter( &env, x, y, NUM_VALUES );
    _pg_setchardef( '*', old_def );
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #19
0
main()
{
    chartenv env;

    _setvideomode( _VRES16COLOR );
    _pg_initchart();
    _pg_defaultchart( &env,
		      _PG_SCATTERCHART, _PG_POINTANDLINE );
    strcpy( env.maintitle.title, "Scatter Chart" );
    _pg_analyzescatterms( &env, x, y, NUM_SERIES,
			  NUM_VALUES, NUM_VALUES, labels );
    /* display x-axis labels with 2 decimal places */
    env.xaxis.autoscale = 0;
    env.xaxis.ticdecimals = 2;
    _pg_chartscatterms( &env, x, y, NUM_SERIES,
			NUM_VALUES, NUM_VALUES, labels );
    getch();
    _setvideomode( _DEFAULTMODE );
}
Example #20
0
void main(void)
{
    int x, y, color, index;
    
    _setvideomode(_VRES16COLOR);
    
    //draw 10,000 points
    for(index = 0; index < 10000; index++)
    {
        x = rand() % 640;
        y = rand() % 480;
        color = rand() % 16;
        _setcolor(color);
        _setpixel(x,y);
    }
    
    while(!kbhit()) {}
    
    _setvideomode(_DEFAULTMODE);
}
Example #21
0
main(int argc,char *argv[])
{
	int	a;
	FILE	*f1;
	if(argc==1)
	{
		printf("usage: FONT <srclbm> <desttmpfont>");
		return(0);
	}
	_setvideomode(_VRES16COLOR);
	for(a=0;a<256;a++)
	{
		f_off[a]=0;
		f_wid[a]=0;
		f_hig[a]=0;
	}
	avercnt=0; averwid=0;
	out=fopen(argv[2],"wb");
	putw(0x1a1a,out);
	putw(tablep,out);
	fwrite(tablex,1,256,out);
	fwrite(tabley,1,256,out);
	f1=fopen(argv[1],"rb");
	readlbm(f1);
	{
		char buf[64];
		int x0,y0,x,y,a;
		for(y0=2;y0<7*8-2;y0+=8)
		  for(x0=0;x0<56*8;x0+=8)
		{
			for(a=x=0;x<8;x++) for(y=0;y<8;y++)
			{
				if((buf[x+y*8]=_getpixel(x0+x,y0+y))==0) a=1;
			}
			if(a)
			{
				tablex[tablep]=x0/8;
				tabley[tablep++]=(y0-2)/8;
				for(y=0;y<8;y++) 
				{
					for(a=x=0;x<8;x++)
					{
						if(!buf[x+y*8]) a+=128>>x;
					}
					putc(a,out);
				}
				_setcolor(15);
			}
			else _setcolor(8);
			_setpixel(x0,y0);
		}
	}
Example #22
0
_WCRTLINK short _WCI86FAR _CGRAPH _setvideomoderows( short mode, short rows )
/*============================================================

   This routine sets the video mode if it is supported by the current
   hardware configuration, then sets the number of text rows requested. It
   returns the number of text rows if successful, otherwise it returns 0.   */

{
    if( _setvideomode( mode ) ) {
        return( _settextrows( rows ) );
    }
    return( 0 );
}
Example #23
0
void
main( int argc, char **argv )
   {
#if MS_CMDS
   struct videoconfig vc;
   short videomode;

   /* Save original foreground, background, and text position. */

   _getvideoconfig( &vc );
   oldfgd = _gettextcolor();
   oldbgd = _getbkcolor();

   if ( vc.mode != _TEXTC80 )
      {
      if ( _setvideomode( _TEXTC80 ) == 0 )
         {
	 _getvideoconfig( &vc );
	 prn_xprintf( stderr, "Failed to set color video mode\n" );
         }
      else
	 {
	 reset_mode = FALSE;
	 }
      }
   else
      {
      reset_mode = FALSE;
      }

#endif       /* MS_CMDS */

   bwb_init( argc, argv );

#if INTERACTIVE
   setjmp( mark );
#endif

   /* now set the number of colors available */

   * var_findnval( co, co->array_pos ) = (bnumber) vc.numcolors;

   /* main program loop */

   while( !feof( stdin ) )		/* condition !feof( stdin ) added in v1.11 */
      {
      bwb_mainloop();
      }

   }
Example #24
0
void Do_Demo2( short mode )
/*=========================

    This program draws bar and pie graphs for the
    data specified above. */

{
    if( !_setvideomode( mode ) ) return;
    _getvideoconfig( &VC ); /* fill videoconfig structure */
    TitleColour = ( VC.numcolors - 1 ) % 16;
    Title();
    BarGraph();
    PieGraph();
    Press_any_key();
}
Example #25
0
main()
{
    int i, j, rows;
    char buf[ 80 ];

    for( i = 0; i < 8; ++i ) {
	rows = valid_rows[ i ];
	if( _settextrows( rows ) == rows ) {
	    for( j = 1; j <= rows; ++j ) {
		sprintf( buf, "Line %d", j );
		_settextposition( j, 1 );
		_outtext( buf );
	    }
	    getch();
	}
    }
    _setvideomode( _DEFAULTMODE );
}
Example #26
0
int main( void )
/*============*/
{
    int     i;

    if( !InitScreen() ) {
        puts( "No graphics adapter present" );
        return( 1 );
    }
    Do_Demo1();
    Press_any_key();

    for( i = 0; modes[i]; ++i ) {
        Do_Demo2( modes[i] );
    }
    _setvideomode( _DEFAULTMODE );      /* reset the screen */

    return( 0 );
}
Example #27
0
void
bwx_terminate( void )
   {
#if MS_CMDS

   if ( reset_mode == TRUE )
      {

      _setvideomode( _DEFAULTMODE );

      /* Restore original foreground and background. */

      _settextcolor( oldfgd );
      _setbkcolor( oldbgd );

      }

#endif

   exit( 0 );
   }
Example #28
0
File: main.c Project: badcodes/c
void set_video_mode(struct videoconfig* out) {
    int mode;
    struct videoconfig vc;
    _getvideoconfig( &vc );
    switch( vc.adapter ) {
    case _VGA :
    case _SVGA :
        mode = _VRES16COLOR;
        break;
    case _MCGA :
        mode = _MRES256COLOR;
        break;
    case _EGA :
        if( vc.monitor == _MONO ) {
            mode = _ERESNOCOLOR;
        } else {
            mode = _ERESCOLOR;
        }
        break;
    case _CGA :
        mode = _MRES4COLOR;
        break;
    case _HERCULES :
        mode = _HERCMONO;
        break;
    default :
        mode = -1;
        cputs( "No graphics adapter\n" );
        break;
    }
    if(mode == -1) {
        _getvideoconfig(out);
    }
    else if(_setvideomode( mode ) ) {
        _getvideoconfig( out );
    }
}
Example #29
0
File: RD_DEMO.C Project: fourks/16
int main
(
  int argc,
  char **argv
)
{
  int i;                /* Scratch counter                              */
  int vmode;            /* Video mode                                   */
  BOOL status = FALSE;  /* Return status                                */

  /* Display program title                                              */

  puts("\nRD_DEMO - PCX Image File Display Demonstration Program\n");

  if (argc == 3)        /* Check for filename and video mode parameters */
  {
    vmode = atoi(argv[2]);      /* Get the video mode                   */

    /* Validate the video mode (must be valid MS-DOS graphics mode)     */

    if ((vmode >= 4 && vmode <= 6) || (vmode >= 13 && vmode <= 19))
      status = TRUE;
  }

  if (status == TRUE)
  {
    if (_setvideomode(vmode) == 0)      /* Set the video mode           */
    {
      /* Report error                                                   */

      fprintf(stderr,
          "ERROR: could not set display adapter to mode %d.\n", vmode);

      return (2);
    }

    /* Read and display the file (assume video page zero)               */

    if ((status = pcx_read(argv[1], vmode, 0)) == TRUE)
    {
      while (!kbhit())  /* Wait for a keystroke                         */
        ;

      (void) getch();   /* Clear the keyboard buffer                    */
    }

    (void) _setvideomode(_DEFAULTMODE);         /* Reset the video mode */

    if (status == FALSE)
    {
      /* Report error                                                   */

      fprintf(stderr, "\nRD_DEMO - PCX Image File Display Demonstration");
      fprintf(stderr, " Program\n\nERROR: Could not read file %s.\n",
          argv[1]);
    }
  }
  else          /* Display usage information                            */
  {
    while (use_msg[i] != (unsigned char *) NULL)
      fputs(use_msg[i++], stderr);
  }

  if (status == TRUE)
    return (0);
  else
    return (2);
}
Example #30
0
main()
{
   char  channels[80],
         color_transform[80],
         file_name[80],
         response[80];

   int   a,
         b,
         c,
	 channel,
	 double_display,
	 horizontal,
         ie,
         il,
         key,
         le,
         ll,
         not_finished,
	 r,
	 vertical,
	 x_offset,
	 y_offset;


   unsigned int block,
                color,
                i,
                j,
                x,
                y;

   unsigned long histogram[256];


   _setvideomode(_TEXTC80);         /* MSC 6.0 statements */
   _setbkcolor(1);
   _settextcolor(7);
   _clearscreen(_GCLEARSCREEN);

   strcpy(file_name, "d:/images/nbrite.dat");
   strcpy(channels, "Single channel");
   strcpy(color_transform, "Modified transform");
   channel = 1;
   il      = 1;
   ll      = 100;
   ie      = 1;
   le	   = 100;
   horizontal = 5;
   vertical   = 4;
   double_display = 0;

   printf("\nThis is the display program.");
   printf("\nThis program can either display a 300x500 section of");
   printf("\nan image or three channels of a 100x500 section of an");
   printf("\nimage. The parameters entered describe the upper left");
   printf("\n100x100 corner of the display.");

   not_finished = 1;
   while(not_finished){

      display_menu(channels, color_transform);
      get_image_name(file_name);
      get_parameters(&channel, &il, &ie, &ll, &le,
		     &horizontal, &vertical, &double_display);


	/*******************************************
	*
	*   we want to set an offset so the image is
	*   centered on the CRT
	*
	********************************************/

	   x_offset = 0;
	   y_offset = 0;
	   x_offset = (6-horizontal)*100;
	   x_offset = 20 + x_offset/2;
	   y_offset = (4-vertical)*100;
	   y_offset = 40 + y_offset/2;



           /*********************************************
           *
           *   If the color_transform requires histogram
           *   equalization, then calculate the histogram
           *   from the four corners of the image.  You
           *   will use this in the display loop below
           *   to equalize the image.
           *
           **********************************************/

      if(color_transform[0] == 'H'){
         printf("\nCalculating histograms");
         zero_long_histogram(histogram);
         printf("\n\t1");
         read_image(image, file_name, channel, il, ie, ll, le);
         calculate_long_histogram(image, histogram);
         printf("\n\t2");
	 read_image(image, file_name, channel, il+400, ie,
		    ll+400, le);
         calculate_long_histogram(image, histogram);
         printf("\n\t3");
	 read_image(image, file_name, channel, il,
		    ie+400, ll, le+400);
         calculate_long_histogram(image, histogram);
         printf("\n\t4");
         read_image(image, file_name, channel, il+400, ie+400,
		    ll+400, le+400);
         calculate_long_histogram(image, histogram);
for(a=0; a<256; a++)
printf("\nh[%4d] = %8d", a, histogram[a]);
      }  /* ends if color_transform == H */


           /*********************************************
           *
           *   Find out what the key should be. This
           *   requires looking at the name of the image
           *   that is being displayed. Use a different
           *   key for the three different channels of
           *   the image.
           *
           **********************************************/

      key = 0;
      if(file_name[16] == '1')
         key = 1;
      if(file_name[16] == '2')
         key = 2;
      if(file_name[16] == '3')
         key = 3;
      if( (file_name[16] == '.') &&
          (channel == 1))
         key = 1;
      if( (file_name[16] == '.') &&
          (channel == 2))
         key = 2;
      if( (file_name[16] == '.') &&
          (channel == 3))
         key = 3;

  /* set graphics mode */
/*******
     map_16_shades_of_gray(_VRES16COLOR);
     blank_out_display();
********/

my_set_colors();




	  /***************************************************
          *
          *   If a single channel is desired then display a 300x500
	  *   section of one channel. If multiple channels
	  *   are desired then display one 100x500 section
	  *   of the image three times.
          *
	  *****************************************************/

      if( (channels[0] == 'S')  ||
	  (channels[0] == 's')){

	 for(a=0; a<horizontal; a++){
	    for(b=0; b<vertical; b++){
               x = a*100;
               y = b*100;
               read_image(image, file_name, channel, il+y, ie+x,
			   ll+y, le+x);

               if(color_transform[0] == 'H')
                  perform_histogram_equalization(image, histogram,
					      16, 40000);

	       if(double_display == 1){

		  if( (a==0) && (b==0)){
		    x_offset = 120;
		    y_offset = 40;
		  }

		  if( (a==0) && (b==1)){
		    x_offset = 120;
		    y_offset = 140;
		  }

		  if( (a==1) && (b==0)){
		    x_offset = 220;
		    y_offset = 40;
		  }

		  if( (a==1) && (b==1)){
		    x_offset = 220;
		    y_offset = 140;
		  }
	       }

               display_image_portion(image, key, color_transform,
				x, y, x_offset, y_offset,
				double_display);
            }  /* ends loop over b                   */
	 }     /* ends loop over a		     */

      }        /* ends if channels == Single channel */



      else{    /* else display three channels        */
         for(a=0; a<5; a++){    /*  Channel 1  */
            x = a*100;
            y =     0;
            read_image(image, file_name, 1, il+y, ie+x, ll+y,
			le+x);
            display_image_portion(image, key, color_transform, x,
				  y, x_offset, y_offset,
				  double_display);
         }  /* ends loop over a  */

         for(a=0; a<5; a++){    /*  Channel 2  */
            x = a*100;
            y =     0;
            color_transform[0] = 'S';
            read_image(image, file_name, 2, il+y, ie+x, ll+y,
		       le+x);
            display_image_portion(image, key, color_transform, x,
				  y+100, x_offset, y_offset,
				  double_display);
         }  /* ends loop over a  */

         for(a=0; a<5; a++){    /*  Channel 3  */
            x = a*100;
            y =     0;
            color_transform[0] = 'S';
            read_image(image, file_name, 3, il+y, ie+x, ll+y,
			le+x);
            display_image_portion(image, key, color_transform, x,
				  y+200, x_offset, y_offset,
				  double_display);
         }  /* ends loop over a  */
      }     /* ends else display multiple channels  */


/******************
      setlinestyle(SOLID_LINE, 0, THICK_WIDTH);
      for(i=0; i<5; i++){
         line(0, i*100, 500, i*100);
      }

      for(i=0; i<6; i++){
         line(i*100, 0, i*100, 300);
      }


      setlinestyle(SOLID_LINE, 0, NORM_WIDTH);
      for(i=0; i<13; i++){
         line(0, i*25, 500, i*25);
      }

      for(i=0; i<21; i++){
         line(i*25, 0, i*25, 300);
      }
******************/


/***********
setusercharsize(1, 2, 1, 2);
settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 0);
outtextxy(10, 320, "done");
***********/


/******************
    The following label the objects in the lower portion of the
image
outtextxy(400, 200, "041 house");
outtextxy(100, 25, "041 house");
outtextxy(100, 200, "040 apartments/hotel");
outtextxy(350, 50, "040 apartments/hotel");
outtextxy(10, 100, "200 decidous");
outtextxy(175, 150, "200 decidous");
*******************/


      read_string(response);
      printf("\nEnter 0 to quit 1 to do again");
      get_integer(&not_finished);

          /* set display back to text mode */
   _setvideomode(_TEXTC80);         /* MSC 6.0 statements */
   _setbkcolor(1);
   _settextcolor(7);
   _clearscreen(_GCLEARSCREEN);


   }  /* ends while not_finished  */

}  /* ends main  */