コード例 #1
0
ファイル: THRESHDlg.cpp プロジェクト: caomw/ImageSegmentor
CTHRESHDlg::CTHRESHDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTHRESHDlg::IDD, pParent)
{
	m_nMaxColor=0;
	bGrayValue = 128;
	m_RMax=255;
	m_RMin=0;
	m_nCur=128;
	for (int i=0; i<GRAYLEVELS; i++)
	{	
		dataChannel[i] = 0;
	}


	InitCoordinate();
	//{{AFX_DATA_INIT(CTHRESHDlg)
	//}}AFX_DATA_INIT
}
コード例 #2
0
void CGlyphCreator::InitMapGlyph()
{
	//获取机场数据
  GetBaseDataFromDB();
  //画机场
  InitCoordinate();
  InitRunwayGlyph();
  InitTaxinglineGlyph();
  InitFixpointGlyph();
  InitGateGlyph();
  InitSysInfoGlyph();
  //初始化空域
  InitNAVPointGlyph();
  InitSectorGlyph();
  InitRestricAreaGlyph();//禁区限制区
  //InitRouteGlyph();//空中航路
  InitMsawAreaGlyph();//最低引导扇区

}
コード例 #3
0
ファイル: 181.C プロジェクト: JackDrogon/Study
/* 游戏控制函数,完成一系列初始化操作,最后调用ManageMove函数,完后便显示谁胜及一些快捷键 */
void GameManage(void)
{
	int Quit=0,key,die,i=1;
	int start_game;
	CurrentCoor player1,player2;	/* 记录游戏者下标位置 */
	clock_t front_time,current_time;
	InitFace();
	HelpMassage();
	GetKey();
	while(Quit==0)
	{
		die=0;
		InitFace();
		InitCoordinate();
		InitPlayerPlace(&player1,&player2);
		Drawbar(player1,1);
		Drawbar(player2,2);
		while(die==0)
		{
			 die=ManageMove(player1,player2);
		}
		setcolor(WHITE);
		if(die==1)
			outtextxy(7,457,"Player2 Win!");
		else if(die==2)
			outtextxy(7,457,"Player1 Win!");
		else
			outtextxy(7,457,"Player1 as same as Player2!");

		front_time=current_time=clock();
		while(current_time-front_time<20)
		{
			current_time=clock();
		}

		setcolor(WHITE);
		outtextxy(257,457,"F1:      F2:       F3:");
		outtextxy(257,467,"Esc:     F4:");
		setcolor(YELLOW);
		outtextxy(257,457,"    Help    Level     Player1 Color");
		outtextxy(257,467,"    Exit    Player2 Color");

		front_time=clock();

		start_game=0;
		while(start_game==0)
		{
			while(!bioskey(1))
			{
				current_time=clock();
				if(current_time-front_time>8)
				{
					front_time=current_time;
					i=(i+1)%2;
					if(i==0)	setcolor(LIGHTRED);
					else		setcolor(BackColor);
					outtextxy(7,467,"Press F5 to continue...");
				}
			}
			key=GetKey();
			if(key==F1)
			{	HelpMassage();
				GetKey();
			}
			else if(key==F2)	Set_Level();
			else if(key==F3)	Set_Color(1);	/* set player1 color */
			else if(key==F4)	Set_Color(2);	/* set player2 color */
			else if(key==F5)	start_game=1;
			else if(key==ESC)
			{		Quit=Exit_Game();
					if(Quit==1)
						start_game=1;
			}
		}
	}
}