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

📄 animator.h

📁 window下的多线程编程参考书。值得一读
💻 H
字号:
//
// FILE: Animator.h
//
// Copyright (c) 1997 by Aaron Michael Cohen and Mike Woodring
//
/////////////////////////////////////////////////////////////////////////
#ifndef __ANIMATOR_H__
#define __ANIMATOR_H__

#include <afxwin.h>
#include <afxext.h>

#include "Mcl4Mfc.h"

// CAnimator class declaration...
class CAnimator : public CStatic, CMclThreadHandler {
protected:
    CBitmap m_cBitmap;
    CBitmap m_cMaskBitmap;
    CBitmap m_cOffscreenBitmap;
    CSize m_czFrame;
    CSize m_czBitmap;
    int m_nFrames;
    BOOL m_bBackAndForth;
    BOOL m_bTransparent;
    int m_nCurrentFrameIndex;
    DWORD m_dwFrameInterval;
    int m_nFrameIncrement;
    CMcl4MfcWorkerThreadAutoPtr m_apAnimationThread;
    CMclEvent m_ceControl;
    CMclCritSec m_CritSec;

protected:
    afx_msg void OnPaint();
    afx_msg void OnDestroy();

    DECLARE_MESSAGE_MAP()

public:
    CAnimator();

    unsigned ThreadHandlerProc(void);

    void SetupAnimation( HBITMAP hBitmap, CSize czFrame, int nFrames, int nFramesPerSecond = 10, BOOL bBackAndForth = FALSE, BOOL bTransparent = FALSE);
    void SetFrameRate( int nFramesPerSecond);
    void SetLoopStyle( BOOL bBackAndForth);
    void SetTransparency( BOOL bTransparent);
    void Start(void);
    void Stop(void);
    void SetFrame( int nFrameNumber);

private:
    void DrawCurrentFrame(CDC *pDC);
    void AdvanceFrame(void);
    void SetupBitmapsForTransparency(void);
    void CleanupBitmapsForTransparency(void);
};

#endif

⌨️ 快捷键说明

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