⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 color.c

📁 This is code tutorial for image processing include:histogram,sketon....
💻 C
字号:



       /***************************************************************
       *
       *       file c:\lsu\color.c
       *
       *       Functions: This file contains
       *           main
       *
       *       Purpose: This program sets the screen to any color
       *	   combination you want.
       *
       *       Modifications:
       *	   1 September 1996 - created
       *
       ***************************************************************/



#include <stdio.h>
#include <graph.h>
#include <io.h>




main()
{

   char response[80];
   long  back, fore; 
   int   i, j, quit, not_done = 1;

   _setvideomode(_TEXTC80);

   while(not_done){
      printf("\nEnter background color (0 - 7): ");
      gets(response);
      back = atoi(response);
      printf("\nEnter foreground color (0 - 15): ");
      gets(response);
      fore = atoi(response);

      if(back >= 0   &&  back <= 7   &&  
         fore >= 0   &&  fore <= 15  &&
         back != fore){
           _setbkcolor(back);
           _settextcolor(fore);
           _clearscreen(_GCLEARSCREEN);
      }

      if(back == fore)
         printf("\nDon't want the letters and the background "
                "to be the same, try again");

      printf("\nIf you want to quit, enter 0");
      printf("\nIf you want to try another, enter 1: ");
      gets(response);
      quit = atoi(response);

      if(quit != 1)
         not_done = 0;

   }  /* ends while not done */

}  /* ends main */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -