資源簡介
通過GDI實現(xiàn)圖片切割、位移,同時通過按鍵實現(xiàn)圖塊運動

代碼片段和文件信息
//?MainFrm.cpp?:?CMainframe?類的實現(xiàn)
//
#include?“stdafx.h“
#include?“Puzzle.h“
#include?“MainFrm.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#endif
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
ON_WM_CREATE()
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR????????????//?狀態(tài)行指示器
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
ID_SEPARATOR
};
//?CMainframe?構(gòu)造/析構(gòu)
CMainframe::CMainframe()
{
//?TODO:?在此添加成員初始化代碼
}
CMainframe::~CMainframe()
{
}
int?CMainframe::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
if?(CframeWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
if?(!m_wndToolBar.CreateEx(this?TBstyle_FLAT?WS_CHILD?|?WS_VISIBLE?|?CBRS_TOP
|?CBRS_GRIPPER?|?CBRS_TOOLTIPS?|?CBRS_FLYBY?|?CBRS_SIZE_DYNAMIC)?||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“未能創(chuàng)建工具欄\n“);
return?-1;??????//?未能創(chuàng)建
}
if?(?!m_wndStatusBar.Create(this)?||
!m_wndStatusBar.SetIndicators(indicators?sizeof(indicators)/sizeof(UINT))?)
{
TRACE0(“未能創(chuàng)建狀態(tài)欄\n“);
return?-1;??????//?未能創(chuàng)建
}
m_wndStatusBar.SetPaneInfo(?0?0?0?140?);
m_wndStatusBar.SetPaneInfo(?1?0?0?140?);
m_wndStatusBar.SetPaneInfo(?2?0?0?140?);
m_wndStatusBar.SetPaneInfo(?3?0?0?140?);
m_wndStatusBar.SetPaneInfo(?4?0?0?140?);
m_wndStatusBar.SetPaneText(?1?_T(““)?);
m_wndStatusBar.SetPaneText(?2?_T(““)?);
m_wndStatusBar.SetPaneText(?3?_T(““)?);
m_wndStatusBar.SetPaneText(?4?_T(““)?);
//?TODO:?如果不需要工具欄可停靠,則刪除這三行
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return?0;
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?在此處通過修改
//??CREATESTRUCT?cs?來修改窗口類或樣式
CRect?rect;
CWnd?*dwnd=GetDesktopWindow();
dwnd->GetWindowRect(rect);
cs.cx?=?913;
cs.cy?=?501;
cs.style?&=?~(WS_THICKframe?|?WS_MAXIMIZEBOX);
cs.x=(rect.Size().cx-910)/2;
cs.y=(rect.Size().cy-501)/2;
return?TRUE;
}
//?CMainframe?診斷
#ifdef?_DEBUG
void?CMainframe::AssertValid()?const
{
CframeWnd::AssertValid();
}
void?CMainframe::Dump(CDumpContext&?dc)?const
{
CframeWnd::Dump(dc);
}
#endif?//_DEBUG
//?CMainframe?消息處理程序
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-11-21?15:49??Puzzle\
?????目錄???????????0??2012-11-21?15:48??Puzzle\Puzzle\
?????文件?????????883??2012-10-23?15:08??Puzzle\Puzzle.sln
?????文件???????46080??2012-11-21?15:49??Puzzle\Puzzle.suo
?????文件????????2429??2012-11-01?15:02??Puzzle\Puzzle\MainFrm.cpp
?????文件?????????652??2012-10-24?10:24??Puzzle\Puzzle\MainFrm.h
?????文件???????49416??2012-11-01?14:57??Puzzle\Puzzle\Puzzle.aps
?????文件????????3355??2012-11-01?14:50??Puzzle\Puzzle\Puzzle.cpp
?????文件?????????466??2012-10-23?15:08??Puzzle\Puzzle\Puzzle.h
?????文件???????10054??2012-11-01?14:45??Puzzle\Puzzle\Puzzle.rc
?????文件????????5820??2012-11-14?14:16??Puzzle\Puzzle\Puzzle.vcproj
?????文件????????1411??2012-11-21?15:49??Puzzle\Puzzle\Puzzle.vcproj.DEV.yux1040.user
?????文件????????1014??2012-10-23?15:08??Puzzle\Puzzle\PuzzleDoc.cpp
?????文件?????????546??2012-10-23?15:08??Puzzle\Puzzle\PuzzleDoc.h
?????文件???????10451??2012-11-01?14:46??Puzzle\Puzzle\PuzzleView.cpp
?????文件????????1813??2012-10-24?17:02??Puzzle\Puzzle\PuzzleView.h
?????文件????????3406??2012-10-23?15:08??Puzzle\Puzzle\ReadMe.txt
?????目錄???????????0??2012-10-24?11:55??Puzzle\Puzzle\res\
?????文件????????1085??2012-11-01?14:57??Puzzle\Puzzle\Resource.h
?????文件???????21630??2005-12-08?14:56??Puzzle\Puzzle\res\Puzzle.ico
?????文件?????????362??2012-10-23?15:08??Puzzle\Puzzle\res\Puzzle.rc2
?????文件????????1078??2005-12-08?14:56??Puzzle\Puzzle\res\PuzzleDoc.ico
?????文件?????????478??2012-10-24?11:55??Puzzle\Puzzle\res\Toolbar.bmp
?????文件?????????137??2012-10-23?15:45??Puzzle\Puzzle\stdafx.cpp
?????文件????????2489??2012-10-23?15:08??Puzzle\Puzzle\stdafx.h
?????目錄???????????0??2012-11-21?15:49??Puzzle\release\
?????文件???????65536??2012-11-14?14:16??Puzzle\release\Puzzle.exe
- 上一篇:生成任意格式任意大小文件的工具
- 下一篇:SublimeServer
評論
共有 條評論