怎样实现动画背景旗帜(4)
// Change Bitmap index
if (BmpLoaded == 9)
BmpLoaded = 0;
else
BmpLoaded++;
}
VERIFY(m_bmpBackGround2.GetObject(sizeof(bm2), (LPVOID) &bm2));
dcMem2.CreateCompatibleDC(NULL);
dcMem2.SelectObject(&m_bmpBackGround2);
pDC->StretchBlt(200, 100, 400, 200, &dcMem2, 0, 0, bm2.bmWidth, bm2.bmHeight,
SRCCOPY);
ReleaseDC(pDC);
}
void CMdiMainClient::OnRButtonDown(UINT nFlags, CPoint point)
{
if (StopRotation)
StopRotation = FALSE;
else
StopRotation = TRUE;
CWnd::OnRButtonDown(nFlags, point);
}
void CMdiMainClient::OnLButtonDown(UINT nFlags, CPoint point)
{
m_Hide_Logo = TRUE;
KillTimer(0);
// Display Application
((CBannerApp*)AfxGetApp())->pDocTemplate->OpenDocumentFile(NULL);
CWnd::OnLButtonDown(nFlags, point);
}
// MdiMainClient.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CMdiMainClient window
extern BOOL m_Hide_Logo;
class CMdiMainClient: public CWnd
{
// Construction
public:
CMdiMainClient();
// Attributes
protected:
CBitmap m_bmpBackGround2;
CBitmap m_bmpBackGround;
int BmpLoaded;
public:
BOOL StopRotation;
CSize m_sizeClient;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMdiMainClient)
//}}AFX_VIRTUAL
// Implementation
public:
void Display_Blank_Bitmap();
void DisplayNextLogoFrame();
virtual ~CMdiMainClient();
// Generated message map functions
protected:
//{{AFX_MSG(CMdiMainClient)
// NOTE - the ClassWizard will add and remove member functions here.
afx_msg BOOL OnEraseBkgnd(CDC *pDC);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
- 上一篇:在对话框中动态显示位图
- 下一篇:Visual C++中建立滚动视窗