資源簡介
連連看游戲,win32應用程序實現,簡單的一些圖片繪制顯示而已,其中的聯通算法思路比較清晰,容易理解,是一個游戲教程的,這里我把它換成win32實現

代碼片段和文件信息
#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::SetWindow_width_height(int?xint?y)
{
screenwidth=x;
screenheight=y;
}
void?MYBITMAP::Show(int?xint?yint?xframe?int?yframe)
{
xpos=x;
ypos=y;
Selectobject(hdcsrchBm);
BitBlt(hdcdestxposyposwidthheighthdcsrcxframe*widthyframe*heightSRCCOPY);
}
void?MYBITMAP::Show()
{
Selectobject(hdcsrchBm);
//?::StretchBlt?(hdcdest00xposyposhdcsrc00widthheightSRCCOPY);?//縮放
BitBlt(hdcdestxposyposwidthheighthdcsrcxframenow*widthyframenow*heightSRCCOPY);
}
//?去背顯示
void?MYBITMAP::Draw(int?xint?yint?xframe?int?yframe)
{
Selectobject(hdcsrchBm);
BitBlt(hdcdestxy
widthheight
hdcsrcxframe*widthheightSRCAND);
BitBlt(hdcdestxy
widthheight
hdcsrcxframe*width0SRCPAINT);
}
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(hdcdestxposyposwidthheighthdcsrcxframenow*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::ShowNoBackX(int?xint?yint?iframe)
{
Selectobject(hdcsrchBm);
BitBlt(hdcdestxy
widthheight
hdcsrciframe*widthheightSRCAND);
BitBlt(hdcdestxy
widthheight
hdcsrciframe*width0SRCPAINT);
}
void?MYBITMAP::ShowNoBackY(int?xint?yint?iframe)
{
Selectobject(hdcsrchBm);
BitBlt(hdcdestxy
widthheight
hdcsrcwidthiframe*heightSRCAND);
BitBlt(hdcdestxy
widthheight
hdcsrc0iframe*heightSRCPAINT);
}
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))
xframenow=0;
return?1;
}
int?MYBITMAP::MouseOver(int?xint?y)
{
if(x(xpos+width)?||?y(ypos+height))
return?0;
xframenow=1;
return?1;
}
int?MYBITMAP::De
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????774199??2012-05-03?15:57??可執行程序\LLK.exe
?????文件?????386622??2012-01-03?22:37??animal.bmp
?????文件??????54934??2012-01-03?22:37??BACK.bmp
?????文件???????9855??2012-05-03?15:57??bitmaptool.cpp
?????文件???????4700??2012-01-12?23:23??bitmaptool.h
?????文件???????6524??2012-05-07?14:11??LLK.CPP
?????文件???????4574??2012-01-07?23:39??LLK.dsp
?????文件????????514??2011-12-18?21:13??LLK.dsw
?????文件????????111??2012-01-09?21:15??LLK.H
?????文件??????74752??2012-05-07?14:11??LLK.ncb
?????文件??????51712??2012-05-07?14:11??LLK.opt
?????文件???????2163??2012-01-08?22:54??LLKRESOURD.RC
?????文件????????635??2012-01-08?22:54??resource.h
?????文件???????9168??2012-01-20?15:25??SKY_LLK.CPP
?????文件???????2098??2012-01-13?23:28??SKY_LLK.H
?????文件????????318??2011-12-18?22:31??small.ico
?????文件????????216??2012-01-12?23:10??StdAfx.h
?????目錄??????????0??2012-05-07?14:10??可執行程序
?????目錄??????????0??2012-05-07?14:12??Debug
-----------?---------??----------?-----??----
??????????????1383095????????????????????19
- 上一篇:轉基于卷積神經網絡的車牌照字符識別研究
- 下一篇:小米5原理圖元件分布圖維修圖紙
評論
共有 條評論