⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bmpmovieview.h

📁 vc程序设计技巧与实例中关于多媒体技术的vc++原代码
💻 H
字号:
// BMPMovieView.h : interface of the CBMPMovieView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_BMPMOVIEVIEW_H__994801E8_DD21_4DC4_8285_D49BBE5215D0__INCLUDED_)
#define AFX_BMPMOVIEVIEW_H__994801E8_DD21_4DC4_8285_D49BBE5215D0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define		FRAME_NUM	6
#define		FRAME_TIME	250

class CBMPMovieView : public CView
{
protected: // create from serialization only
	CBMPMovieView();
	DECLARE_DYNCREATE(CBMPMovieView)

// Attributes
public:
	CBMPMovieDoc* GetDocument();

private:
	CBitmap		m_Bitmap[FRAME_NUM];    //装载要显示位图对象
	int			m_nFrameWidth;          //图象宽度
	int			m_nFrameHeight;         //图象高度
	CPoint		m_ptCurPos;				//当前的滚动位置	
	int			m_nCurFrameNo;          //当前显示的图象编号
	int			m_nStepX;				//水平方向上的步进量
	int			m_nStepY;               //垂直方向上的不进量

	CBrush      m_BKBrush;				//用来创建所需的背景刷子
	UINT        m_IDTimer;              //定时器ID

// Operations
public:
	void	ClearLastFrame(CPoint ptCurPos);
	void	CalcNewPos(CPoint& ptCurPos);
	BOOL	DisplayFrame(CPoint ptCurPos, int nCurFrameNo);
	void	CalcNewFrameNo(int& nCurFrameNo);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBMPMovieView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CBMPMovieView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CBMPMovieView)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnDestroy();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in BMPMovieView.cpp
inline CBMPMovieDoc* CBMPMovieView::GetDocument()
   { return (CBMPMovieDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_BMPMOVIEVIEW_H__994801E8_DD21_4DC4_8285_D49BBE5215D0__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -