正在加载图片...
附录5:七巧板程序 附录5:七巧板程序 / Example13-7:七巧板程序 #include <afxwin. h> ∥/拼板类 #define maX points #define ChIP Width 240 #define delta class CChip: public CObject DECLARE SERIAL (CChip) CPoint m pointList [MAX POINTS int m nPointCount bli CChipo( voidSetChip(int type, POINT *ppointlist, int count) void DrawChip(CDC *pDC) BOOLPt In Chip (point point) LPCRECT GetRect o void Move To(CSize offset voidSerialize(CArchive &ar) IMPLEMENT SERIAL (CChip, COb ject, 1) /设置拼图块参数 void CChip: SetChip (int type, POINT *ppointlist, int count m for (int i=0; i<count: i++)附录 5:七巧板程序 372 附录 5: 七巧板程序 // Example 13-7: 七巧板程序 ////////////////////////////////// #include <afxwin.h> #include <afxext.h> // 拼板类 //////////////////////////////////////////////////// #define MAX_POINTS 4 #define CHIP_WIDTH 240 #define DELTA 30 class CChip : public CObject { DECLARE_SERIAL(CChip) int m_nType; CPoint m_pointList[MAX_POINTS]; int m_nPointCount; public: CChip(){} voidSetChip(int type, POINT *ppointlist, int count); voidDrawChip(CDC *pDC); BOOLPtInChip(POINT point); LPCRECT GetRect(); voidMoveTo(CSize offset); voidRotation(); voidSerialize(CArchive &ar); }; IMPLEMENT_SERIAL(CChip, CObject, 1) // 设置拼图块参数 void CChip::SetChip(int type, POINT *ppointlist, int count) { m_nType = type; m_nPointCount = count; for(int i=0; i<count; i++)
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有