// SlidePicture.cpp : implementation file // #include "stdafx.h" #include "SlidePicture.h" #include "tuanmanage.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSlidePicture CSlidePicture::CSlidePicture() { m_nRow = 4; m_nCol = 4; } CSlidePicture::~CSlidePicture() { } BEGIN_MESSAGE_MAP(CSlidePicture, CStatic) //{{AFX_MSG_MAP(CSlidePicture) ON_WM_MOUSEWHEEL() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSlidePicture message handlers void CSlidePicture::DividePicture(Array &rectArray) { CRect rect; GetWindowRect(rect); CRect rec; rect.DeflateRect(2,2); rectArray.Clear(); int n,m; n = (rect.right - rect.left)/m_nCol; m = (rect.bottom - rect.top)/m_nRow; for (int i = 0;i < m_nRow;i ++) { for (int j = 0;j < m_nCol;j++) { rec.top = rect.top + m * i; rec.left = rect.left + n * j; rec.right = rec.left + n; rec.bottom = rec.top + m; rec.DeflateRect(2,2); rectArray.AddTail(rec); } } } int CSlidePicture::PageSize() { return m_nCol * m_nRow; } BOOL CSlidePicture::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) { // TODO: Add your message handler code here and/or call default m_Dlg->MouseWheel(zDelta); return CStatic::OnMouseWheel(nFlags, zDelta, pt); }