-
大小: 791KB文件類型: .rar金幣: 2下載: 1 次發(fā)布日期: 2021-06-15
- 語(yǔ)言: C/C++
- 標(biāo)簽: C語(yǔ)言??課程設(shè)計(jì)??波形??波形顯示??
資源簡(jiǎn)介
設(shè)計(jì)最后得分優(yōu)秀,而且免答辯。
代碼清晰易懂,你絕對(duì)值得擁有。

代碼片段和文件信息
BOXINGTEST.cpp?:?Defines?the?entry?point?for?the?application.
//
#include“sysmets.h“
#include?“stdafx.h“
#include?“resource.h“
#include
#include
#include?
#define?MAX_LOADSTRING?100
#define?WM_MOUSEWHEEL?0x020A
#define?WM_TIMER?0x0113
int?map[2000][2000]={0};
struct?Bullet
{
int?xy;
int Exist;
};
struct?grid
{
int?Height;
int?Width;
};
short??zDelta;
int??fwKeys;
short??xPos;
short??yPos;
int?TotalB=0;
int ti=0;
struct?Bullet?b[1000000]={0};
struct?grid?mygrid;
void?DrawMap(HDC?hdc);
void?DrawBullet(HDC?hdcstruct?Bullet?*pb);
void?EraseBullet(HDC?hdcstruct?Bullet?*pb);
RECT rtWindow; //整個(gè)窗口大小,一開始就設(shè)置好,省得每次畫圖都查一遍。
HPEN Bulletframe;
HBRUSH BulletBody;
//?Global?Variables:
HINSTANCE?hInst;
HWND?hWnd; //?current?instance
TCHAR?sztitle[MAX_LOADSTRING]; //?The?title?bar?text
TCHAR?szWindowClass[MAX_LOADSTRING]; //?The?title?bar?text
//?Foward?declarations?of?functions?included?in?this?code?module:
ATOM MyRegisterClass(HINSTANCE?hInstance);
BOOL InitInstance(HINSTANCE?int);
LRESULT?CALLBACK WndProc(HWND?UINT?WPARAM?LPARAM);
LRESULT?CALLBACK About(HWND?UINT?WPARAM?LPARAM);
LRESULT?CALLBACK????Input(HWND?UINT?WPARAM?LPARAM);
void?DrawMap(HDC?hdc)//畫網(wǎng)格
{
RECT?rt;
HPEN frame;
HBRUSH brush;
HGDIOBJ oldpoldb;
GetClientRect(hWnd?&rt);
int ijwhxy;
w=mygrid.Width;
h=mygrid.Height;
if(mygrid.Height!=0&&mygrid.Width!=0)
{
for(i=0;i<(rt.right-rt.left)/(mygrid.Width)+1;i++)
for(j=0;j<(rt.bottom-rt.top)/(mygrid.Height)+1;j++)
{
????x=i*w;
y=j*h;
switch(map[i][j])
{
case?0:
frame=CreatePen(PS_SOLID0RGB(0500));
brush=CreateSolidBrush(RGB(000));
oldp=Selectobject(hdcframe);
oldb=Selectobject(hdcbrush);
Rectangle(hdcxyx+wy+h);
Selectobject(hdcoldb);
Selectobject(hdcoldp);
Deleteobject(frame);
Deleteobject(brush);
break;
}
}
}
}
void?DrawBullet(HDC?hdcstruct?Bullet*pb)//畫粒子
{
HGDIOBJ?OldBrush=Selectobject(hdcBulletBody);
HGDIOBJ?OldPen=Selectobject(hdcBulletframe);
Ellipse(hdcpb->x-2pb->y-2pb->x+2pb->y+2);
Selectobject(hdcOldBrush);
Selectobject(hdcOldPen);
}
void?EraseBullet(HDC?hdcstruct?Bullet*pb)//擦粒子
{
HBRUSH?WhiteBrush=CreateSolidBrush(RGB(000));
HPEN???WhitePen=CreatePen(PS_SOLID1RGB(000));
HGDIOBJ?oldBrush=Selectobject(hdcWhiteBrush);
HGDIOBJ?oldPen=Selectobject(hdcWhitePen);
Rectangle(hdcpb->x-2pb->y-2pb->x+2pb->y+2);
Selectobject(hdcoldPen);
Selectobject(hdcoldBrush);
Deleteobject(WhiteBrush);
Deleteobject(WhitePen);
}
int?APIENTRY?WinMain(HINSTANCE?hInstanceHINSTANCE?hPrevInstanceLPSTR?lpCmdLineint?nCmdShow)
{
? //?TODO:?Place?code?here.
int?i=0;
static?TCHAR?szAppName[]=TEXT(“SysMets“);
MSG?msg;
HACCEL?hAccelTable;
srand(time(NULL));
//?Initialize?global?strings
LoadString(hInstance?IDS_APP_title?sztitle?MAX_LOADSTRING);
Lo
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????6168??2013-06-28?09:20??波形顯示\C_Win\boxingtest\boxingtest.aps
?????文件???????8652??2013-06-28?09:20??波形顯示\C_Win\boxingtest\boxingtest.cpp
?????文件???????4541??2013-06-28?09:19??波形顯示\C_Win\boxingtest\boxingtest.dsp
?????文件????????338??2013-06-28?09:19??波形顯示\C_Win\boxingtest\boxingtest.h
?????文件???????1078??2013-06-28?09:19??波形顯示\C_Win\boxingtest\boxingtest.ico
?????文件???????2043??2013-06-28?09:20??波形顯示\C_Win\boxingtest\boxingtest.plg
?????文件???????4232??2013-06-28?09:20??波形顯示\C_Win\boxingtest\boxingtest.rc
?????文件?????241770??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\boxingtest.exe
?????文件?????293784??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\boxingtest.ilk
?????文件??????16406??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\boxingtest.obj
?????文件????1956332??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\boxingtest.pch
?????文件?????435200??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\boxingtest.pdb
?????文件???????2408??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\boxingtest.res
?????文件??????55480??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\StdAfx.obj
?????文件??????91136??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\vc60.idb
?????文件?????176128??2013-06-28?09:20??波形顯示\C_Win\boxingtest\Debug\vc60.pdb
?????文件???????2105??2013-06-28?09:19??波形顯示\C_Win\boxingtest\ReadMe.txt
?????文件???????1088??2013-06-28?09:20??波形顯示\C_Win\boxingtest\resource.h
?????文件????????318??2013-06-28?09:19??波形顯示\C_Win\boxingtest\small.ico
?????文件????????297??2013-06-28?09:19??波形顯示\C_Win\boxingtest\StdAfx.cpp
?????文件????????936??2013-06-28?09:19??波形顯示\C_Win\boxingtest\StdAfx.h
?????文件????????539??2013-06-28?09:19??波形顯示\C_Win\C_Win.dsw
?????文件??????41984??2013-06-28?09:21??波形顯示\C_Win\C_Win.ncb
?????文件??????48640??2013-06-28?09:21??波形顯示\C_Win\C_Win.opt
?????目錄??????????0??2013-06-30?16:41??波形顯示\C_Win\boxingtest\Debug
?????目錄??????????0??2013-06-30?16:41??波形顯示\C_Win\boxingtest
?????目錄??????????0??2013-06-30?16:41??波形顯示\C_Win
?????目錄??????????0??2013-06-30?16:41??波形顯示
-----------?---------??----------?-----??----
??????????????3391603????????????????????28
............此處省略1個(gè)文件信息
評(píng)論
共有 條評(píng)論