image.c

来自「世界时间代码 。希望能对minigui的初学者有帮助」· C语言 代码 · 共 123 行

C
123
字号
/*以下代码实现图片切换*/static BITMAP bmp;int Beijing_Bmp (HDC hdc){	 if (LoadBitmap (HDC_SCREEN, &bmp, "Beijing.jpg"))	    		 {				printf("LoadBitmap Beijing.jpg Error!");				return -1;			    		 }		    FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);                 Rectangle (hdc, 0, 0, 640, 480);}int Tokyo_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, "Tokyo.jpg"))	   {		printf("LoadBitmap Tokyo.jpg Error!");		return -1;			    }		 FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);              Rectangle (hdc, 0, 0, 640, 480);	}int Newyork_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, "Newyork.jpg"))	  {		printf("LoadBitmap Newyork.jpg Error!");		return -1;			  }		 FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);              Rectangle (hdc, 0, 0, 640, 480);}int Rome_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, "Rome.jpg"))	  {		printf("LoadBitmap Rome.jpg Error!");		return -1;			  }		 FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);              Rectangle (hdc, 0, 0, 640, 480);}int Berlin_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, "Berlin.jpg"))	   {		printf("LoadBitmap Berlin.jpg Error!");		return -1;			   }		 FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);              Rectangle (hdc, 0, 0, 640, 480);}int Paris_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, "Paris.jpg"))	   {		printf("LoadBitmap Paris.jpg Error!");		return -1;			   }		 FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);              Rectangle (hdc, 0, 0, 640, 480);}int London_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, "London.jpg"))	    {		printf("LoadBitmap London.jpg Error!");		return -1;			    }		 FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);              Rectangle (hdc, 0, 0, 640, 480);}int Cairo_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, "Cairo.jpg"))	  {		printf("LoadBitmap Cairo.jpg Error!");		return -1;			  }		FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);             Rectangle (hdc, 0, 0, 640, 480);}int Sydney_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, "Sydney.jpg"))	  {		printf("LoadBitmap Sydney.jpg Error!");		return -1;			  }		FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);             Rectangle (hdc, 0, 0, 640, 480);}int Brazilia_Bmp (HDC hdc){	if (LoadBitmap (HDC_SCREEN, &bmp, " Brazilia.jpg"))	  {		printf("LoadBitmap Brazilia.jpg Error!");		return -1;			  }		FillBoxWithBitmap (hdc, 320, 210, 325, 220, &bmp);             Rectangle (hdc, 0, 0, 640, 480);}

⌨️ 快捷键说明

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