WELCOME.H
上传用户:zhang8947
上传日期:2007-01-08
资源大小:1910k
文件大小:2k
- //显示欢迎画面头文件
- #ifndef _ImageFile
- #define _ImageFile
- DECLARE_HANDLE(HDIB);
- class CImageFile
- {
- public:
- CImageFile() ;
- CImageFile(LPSTR fileName ) ;
- ~CImageFile() ;
- BOOL PaintImage(HDC hDC , CRect *lpRect) ;
- BOOL CreateImage( LPSTR cFileName ) ;
- virtual BOOL ReadImageFile() ;
- int ImageWidth() ;
- int ImageHeight() ;
-
- protected:
-
- virtual BOOL TranslateImageToDIB() ;
- BOOL CreatePalette(CPalette*) ;
- void far* FindDIBBits(LPSTR) ;
- int PaletteSize() ;
- int ImageNumColors() ;
- // member varible
- HDIB m_hDib ;
- void* m_hImageData ;
- int m_nKindOfImage ;
- CPalette* m_palDIB ;
- CString m_strFileName;
- } ;
- #define IMAGE_UNKNOWN 0
- #define PALVERSION 0x300
- #define RECTWIDTH(lpRect) ((lpRect)->right - (lpRect)->left)
- #define RECTHEIGHT(lpRect) ((lpRect)->bottom - (lpRect)->top)
- #endif
- //--------------------------------------------------------------------------------------//
- #ifndef _DibImage_h
- #define _DibImage_h
- class CDibImage : public CImageFile
- {
- public:
- CDibImage() ;
- CDibImage(char * cFileName );
- ~CDibImage() ;
- BOOL ReadImageFile() ;
- protected:
- BOOL ReadDIBFile(CFile& file);
- void InitDIBData();
- } ;
- #endif
- //----------------------------------------------------------------------------------------//
- /////////////////////////////////////////////////////////////////////////////
- // CSplashWnd view
- class CSplashWnd : public CWnd
- {
- DECLARE_DYNCREATE(CSplashWnd)
- protected:
- // protected constructor used by dynamic creation
- // Attributes
- public:
- // Operations
- CSplashWnd();
- virtual ~CSplashWnd();
- BOOL Create( LPSTR lpStr) ;
- private:
-
- CDibImage m_dibImage ;
- // Implementation
- protected:
-
- // Generated message map functions
- protected:
- //{{AFX_MSG(CSplashWnd)
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnPaint();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- //----------------------------------------------------------------------------------//
- //显示欢迎画面
- BOOL WelcomeToYou(CSplashWnd& splashWnd ,LPSTR lpFileName) ;
- //-----------------------------------------------------------------------------------------//