資源簡介
代碼片段和文件信息
#include?“stdafx.h“
#include?“bitmaptool.h“
#include?“gamemap.h“
extern?GAMEMAP?gamemap;
extern?FILEREPORT?f1;
MYBITMAP::MYBITMAP()
{
}
MYBITMAP::~MYBITMAP()
{
Deleteobject(hBm);
}
void?MYBITMAP::Init(HINSTANCE?hInstanceint?iResourceint?rowint?col)
{
BITMAP?bm;
inum=row;
jnum=col;
hBm=LoadBitmap(hInstanceMAKEINTRESOURCE(iResource));
Getobject(hBmsizeof(BITMAP)&bm);
width=bm.bmWidth/inum;
height=bm.bmHeight/jnum;
}
void?MYBITMAP::SetDevice(HDC?hdestHDC?hsrcint?wwinint?hwin)
{
hdcdest=hdest;
hdcsrc=hsrc;
screenwidth=wwin;
screenheight=hwin;
}
void?MYBITMAP::Show(int?xint?y)
{
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrc00SRCCOPY);
}
void?MYBITMAP::ShowCenter(int?y
- 上一篇:c++ 打怪小游戲
- 下一篇:c++控制臺飛機大戰 游戲源碼
評論
共有 條評論