EasyX使用鼠标和背景图片

#include 
#include 
#include 

#pragma comment(lib,"winmm.lib")

int main()
{
	initgraph(800,600);

	IMAGE bk;
	loadimage(&bk, "23.jpg", 800, 600);
	putimage(0, 0, &bk);

	mciSendString("open 童话镇.mp3 alias bm", NULL, 0, NULL);
	mciSendString("play bm repeat", NULL, 0, NULL);


	
	line(100, 100, 400, 100);
	line(350, 50, 400, 100);
	line(350, 150, 400, 100);
	line(100, 100, 100, 400);
	line(100, 400, 150, 350);
	line(100, 400, 50, 350);

	circle(200, 200, 100);
	setfillcolor(GREEN);
	fillellipse(180, 200, 280, 300);

	ellipse(100, 50, 200, 100);

	setbkmode(TRANSPARENT);
	outtextxy(100, 100, "你好,EasyX!");

	MOUSEMSG mmsg;
	while (1)
	{
		//MouseHit();
		mmsg = GetMouseMsg();
		if (mmsg.mkLButton && mmsg.uMsg==WM_LBUTTONDOWN)
		{
			outtext('H');
			MessageBox(NULL, "Hello", "H", MB_OK);
		}


	}

	getch();
	mciSendString("pause bm", NULL, 0, NULL);
	mciSendString("stop bm", NULL, 0, NULL);
	closegraph();
	return 0;
}



 

你可能感兴趣的:(C/C++,EasyX)