资源简介
Win32,游戏编程,很值得学习,对学习Win32消息机制很有帮助

代码片段和文件信息
#include “stdafx.h“
#include “bitmaptool.h“
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::SetDC(HDC hdestHDC hsrc)
{
hdcdest=hdest;
hdcsrc=hsrc;
}
void MYBITMAP::Show(int xint yint iframe)
{
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrciframe*width0SRCCOPY);
}
void MYBITMAP::ShowCenter(int yint iframe)
{
xpos=(screenwidth-width)/2;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrciframe*width0SRCCOPY);
}
void MYBITMAP::ShowCenter(int y)
{
xpos=(screenwidth-width)/2;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrcframenow*width0SRCCOPY);
}
void MYBITMAP::ShowLoop(int leftint topint rightint bottomint iframe)
{
int ij;
Selectobject(hdcsrchBm);
for(j=top;j {
for(i=left;i {
BitBlt(hdcdestijwidthheighthdcsrciframe*width0SRCCOPY);
}
}
}
void MYBITMAP::ShowNoBack(int xint yint iframe)
{
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheight/2hdcsrciframe*widthheight/2SRCAND);
BitBlt(hdcdestxposyposwidthheight/2hdcsrciframe*width0SRCPAINT);
}
void MYBITMAP::ShowNoBackLoop(int xint yint iframeint iNum)
{
int i;
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
for(i=0;i {
BitBlt(hdcdestxpos+i*widthyposwidthheight/2hdcsrciframe*widthheight/2SRCAND);
BitBlt(hdcdestxpos+i*widthyposwidthheight/2hdcsrciframe*width0SRCPAINT);
}
}
int MYBITMAP::MouseOut(int xint y)
{
if(x(xpos+width) || y(ypos+height))
framenow=0;
return 1;
}
int MYBITMAP::MouseOver(int xint y)
{
if(x(xpos+width) || y(ypos+height))
return 0;
framenow=1;
return 1;
}
int MYBITMAP::DetectMouseMove(int xint y)
{
MouseOver(xy);
MouseOut(xy);
return 0;
}
int MYBITMAP::DetectMouseUp(int xint y)
{
if(x(xpos+width) || y(ypos+height))
return 0;
return 1;
}
void MYBITMAP::ShowAni()
{
if(!iStartAni)
return;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheight/2hdcsrcframenow*widthheight/2SRCAND);
BitBlt(hdcdestxposyposwidthheight/2hdcsrcframenow*width0SRCPAINT);
framenow++;
//播放结束
if(framenow>=inum)
iStartAni=0;
}
void MYBITMAP::SetAni(int xint y)
{
xpos=x;
ypos=y;
framenow=0;
iStartAni=1;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 153718 2008-04-13 20:40 挖金子源工程\bitmap1.bmp
.CA.... 2804 2008-04-12 17:23 挖金子源工程\bitmaptool.cpp
.CA.... 1151 2008-04-13 20:22 挖金子源工程\bitmaptool.h
.CA.... 98358 2008-04-12 17:31 挖金子源工程\bomb.bmp
.CA.... 2872 2008-04-13 20:22 挖金子源工程\catch.cpp
.CA.... 621 2008-04-07 17:15 挖金子源工程\catch.h
.CA.... 297 2008-04-07 10:38 挖金子源工程\Debug\ini\match.txt
.CA.... 73782 2008-04-07 16:44 挖金子源工程\equip.bmp
.CA.... 517 2008-03-30 12:05 挖金子源工程\filereport.cpp
.CA.... 225 2008-03-30 12:06 挖金子源工程\filereport.h
.CA.... 6198 2008-04-12 16:53 挖金子源工程\fire.bmp
.CA.... 11089 2008-04-13 20:39 挖金子源工程\gamegold.cpp
.CA.... 5908 2008-04-12 17:37 挖金子源工程\gamegold.dsp
.CA.... 522 2008-03-30 09:20 挖金子源工程\gamegold.dsw
.CA.... 332 2008-03-30 09:20 挖金子源工程\gamegold.h
.CA.... 1078 2008-03-30 09:20 挖金子源工程\gamegold.ico
.CA.... 3938 2008-04-13 20:37 挖金子源工程\gamegold.rc
.CA.... 7000 2008-04-12 20:24 挖金子源工程\gamemap.cpp
.CA.... 1133 2008-04-12 17:02 挖金子源工程\gamemap.h
.CA.... 297 2008-04-07 10:38 挖金子源工程\ini\match.txt
.CA.... 36918 2008-04-07 10:44 挖金子源工程\mapearth.bmp
.CA.... 153654 2008-03-30 15:44 挖金子源工程\mapground.bmp
.CA.... 1910 2008-04-07 11:22 挖金子源工程\mybutton.cpp
.CA.... 718 2008-04-07 11:22 挖金子源工程\mybutton.h
.CA.... 1002 2008-04-02 18:56 挖金子源工程\myclock.h
.CA.... 1601 2008-04-12 16:56 挖金子源工程\myequip.cpp
.CA.... 605 2008-04-12 16:16 挖金子源工程\myequip.h
.CA.... 122934 2008-03-30 19:43 挖金子源工程\ob
.CA.... 2085 2008-03-30 09:20 挖金子源工程\ReadMe.txt
.CA.... 1264 2008-04-13 20:37 挖金子源工程\resource.h
............此处省略77个文件信息
- 上一篇:计算机系统结构郑伟民,汤志忠ppt
- 下一篇:齐敏等.模式识别导论 ppt
相关资源
- flash3.0小游戏
- Scrach 欢乐狙击手.sb2
- linux应用层的华容道游戏源代码
- 小鸡快跑游戏.
- [易语言]游戏多开例程
- 贪吃蛇游戏设计(汇编语言)
- VC 游戏编程—附源代码
- C 纸牌游戏——21点
- 分享 mud 文字游戏 源码
- c 制作的RPG小游戏
- 五子棋游戏实现悔棋功能
- zlib 最新 1.2.8 win32 win64 编译好的dll
- 找不同FLASH游戏源码
- planeGame飞机游戏
- 拼图游戏源代码 powerbuilder 9.0实例
- 解决WPE进不了游戏的最佳方法(闭屏
- linux扫雷游戏代码
- 多线程实例:桌面智能弹球小游戏
- “猜数字”游戏 算法破解
- OpenGL-3D坦克模拟
- 联机版井字棋源码
- 拼图游戏(可自由选择难度)
- 扫雷(MVC架构)
- 解封SHOW 51VV 9158 封机器码类游戏机
- scratch穿越迷宫.sb2
- 小鱼捉迷藏Scratch小游戏
- GlowtoolsA-wdf网易游戏wdf查看及解包
- 游戏音频图像提取工具GARbro
- OPENGL实现世界上最小的3D游戏
- Scrach3.0 跳一跳小游戏
评论
共有 条评论