• 大小: 313KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-07
  • 标签: C++  c++打地鼠  

资源简介

基于c++下的打地鼠设计,能够实现完整的功能

资源截图

代码片段和文件信息

#include “stdafx.h“
#include “CBmp.h“
#include “winbase.h“

CBmp::CBmp( LPTSTR szFileName)
  : m_hBitmap(NULL) m_iWidth(0) m_iHeight(0)
{
LoadByAPI(szFileName);
}



CBmp::~CBmp()
{
Free();
}


void CBmp::Free()
{
if (m_hBitmap != NULL)
{
Deleteobject(m_hBitmap);
m_hBitmap = NULL;
}
}


RGBQUAD palette[256];



BOOL CBmp::LoadByAPI(LPTSTR szFileName)
{
m_hBitmap = (HBITMAP)SHLoadDIBitmap(szFileName);

BITMAP   bm;     
Getobject(m_hBitmap   sizeof(BITMAP)   &bm);   
m_iWidth = bm.bmWidth;   
m_iHeight = bm.bmHeight;
    delete &bm;
if(m_hBitmap == NULL)
{
return false;
}
return true;
}


void CBmp::Draw(HDC hDC int x int y)
{

if (m_hBitmap != NULL)
{
HDC hMemDC = CreateCompatibleDC(hDC);

HBITMAP hO

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-05-30 10:04  打地鼠\
     目录           0  2008-01-28 11:05  打地鼠\Game\
     文件        1022  2007-11-30 18:01  打地鼠\Game\CBmp.cpp
     文件         371  2007-12-03 23:15  打地鼠\Game\CBmp.h
     文件        4906  2007-12-05 22:12  打地鼠\Game\Game.cpp
     文件          40  2007-11-27 19:05  打地鼠\Game\Game.h
     文件       23558  2005-11-12 10:08  打地鼠\Game\Game.ico
     文件        5908  2007-12-02 21:04  打地鼠\Game\Game.vcproj
     文件        1749  2008-01-02 09:38  打地鼠\Game\Game.vcproj.GV.Administrator.user
     文件       25784  2007-11-30 17:59  打地鼠\Game\Gameppc.aps
     文件        2441  2007-11-27 19:54  打地鼠\Game\Gameppc.rc
     文件         874  2007-11-27 20:02  打地鼠\Game\Gameppc.rc2
     文件        7970  2007-12-15 01:21  打地鼠\Game\My_Game.h
     目录           0  2007-12-04 15:49  打地鼠\Game\pic 80×71\
     文件        2958  2007-11-30 17:48  打地鼠\Game\pic 80×71\BackGround.bmp
     文件       17094  2007-11-30 22:39  打地鼠\Game\pic 80×71\Cat.bmp
     文件        6758  2007-11-30 22:39  打地鼠\Game\pic 80×71\HitCat.bmp
     文件        2958  2007-11-30 17:49  打地鼠\Game\pic 80×71\HitMouse.bmp
     文件        6758  2007-11-30 17:49  打地鼠\Game\pic 80×71\Mouse.BMP
     文件       63488  2007-12-05 22:57  打地鼠\Game\pic 80×71\Thumbs.db
     文件        1817  2007-11-27 19:05  打地鼠\Game\ReadMe.txt
     文件         625  2007-11-27 20:01  打地鼠\Game\resourceppc.h
     文件         209  2007-11-27 19:05  打地鼠\Game\stdafx.cpp
     文件        1304  2007-11-27 19:05  打地鼠\Game\stdafx.h
     文件        1685  2007-12-01 16:18  打地鼠\Game\Str_Convert.h
     文件        5120  2007-12-15 15:42  打地鼠\Game\Thumbs.db
     目录           0  2015-05-15 17:57  打地鼠\WindowsApplication1\
     文件         946  2010-03-10 21:39  打地鼠\WindowsApplication1.sln
     文件       18432  2015-06-11 19:32  打地鼠\WindowsApplication1.suo
     目录           0  2015-05-15 17:56  打地鼠\WindowsApplication1\bin\
     目录           0  2015-05-15 17:56  打地鼠\WindowsApplication1\bin\Debug\
............此处省略40个文件信息

评论

共有 条评论