// CImgPlayerDlg.h : 头文件 // #pragma once #include "libimgplayer.h" #include "resource.h" // CImgPlayerDlg 对话框 class CImgPlayerDlg : public CDialogEx { // 构造 public: CImgPlayerDlg(CWnd* pParent = NULL); // 标准构造函数 CImgPlayerDlg(CImgPlayConfig *pConfig, CWnd* pParent = NULL); ~CImgPlayerDlg(); private: BOOL EndPlay(); // 对话框数据 enum { IDD = IDD_IMGPLAYER_DIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 void ShowImage(CImage& img, UINT ID); // 实现 protected: HICON m_hIcon; bool m_bInit;//OnInitDialog是否执行结束 bool m_bTimer;//计时器是否在执行 CImage m_Image;//图像工具 HMONITOR m_hMonitor;//图片显示所在的屏幕句柄 CRect m_monitorRect;//图片显示所在的屏幕位置和大小 CImgPlayConfig *m_pConfig; int m_nPlayCnt; // 已重复播放次数(多张图片顺序播完一次算重复播一次) int m_nPicInx; // 当前图片序号 // 双缓冲机制 CBitmap* m_pOldBitmap; CBitmap* m_pMemBitmap; //声明内存中承载临时图象的位图 CDC* m_pMemDC; //声明用于缓冲作图的内存DC // 生成的消息映射函数 virtual BOOL OnInitDialog(); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() public: afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnClose(); afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg BOOL OnEraseBkgnd(CDC* pDC); };