www.pudn.com > Success5.6.rar > StaticWnd.h


#ifndef   __StaticWnd_h 
#define   __StaticWnd_h 
 
 
// StaticWnd.h : header file 
// 
 
///////////////////////////////////////////////////////////////////////////// 
// CStaticWnd window 
 
class CStaticWnd : public CWnd 
{ 
protected: 
    int m_IDC; 
protected: 
    COLORREF   m_BK_Color; 
    BITMAPINFO   m_Bitmap; 
    unsigned char *m_pImg; 
	UINT m_X; 
	UINT m_Y; 
// Construction 
public: 
	CStaticWnd(int IDC); 
 
// Attributes 
public: 
 
// Operations 
public: 
	/*display a window picture */ 
	int Set_Image(unsigned char *p_Img, unsigned  int m_X,unsigned int m_Y); 
	int Set_BinImage(unsigned char *p_img,unsigned  int X, unsigned int Y,int R=255, int G=0, int B=0); 
	int Set_BinImage(unsigned char *p_img,unsigned  int X, unsigned int Y,COLORREF fg,COLORREF back); 
	int Set_GrayImage(unsigned char *p_img,unsigned  int X, unsigned int Y); 
    virtual int Draw_Wnd(CDC *p_DC);	 
    int Draw_Fit_Wnd(CDC *p_DC);	 
    void Draw_Center(CDC *pDC); 
    void Draw_Center1(CDC *pDC); 
    void Draw_Center2(CDC *pDC); 
	void Draw_Center_(); 
	virtual void Clear_Image(void); 
 
protected: 
    /* set picture display header*/ 
	int Set_BMP_Head(void); 
	int m_ImageSetFlag; 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CStaticWnd) 
	public: 
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); 
	//}}AFX_VIRTUAL 
 
// Implementation 
public: 
	virtual ~CStaticWnd(); 
 
	// Generated message map functions 
protected: 
	//{{AFX_MSG(CStaticWnd) 
	afx_msg void OnPaint(); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
#endif