www.pudn.com > Xread2.rar > Xread2Doc.h
// Xread2Doc.h : interface of the CXread2Doc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_XREAD2DOC_H__EB9CC0EF_710D_40F1_904F_2D957FD6D16A__INCLUDED_)
#define AFX_XREAD2DOC_H__EB9CC0EF_710D_40F1_904F_2D957FD6D16A__INCLUDED_
#include "DIBAPI.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CXread2Doc : public CDocument
{
protected: // create from serialization only
CXread2Doc();
DECLARE_DYNCREATE(CXread2Doc)
// Attributes
public:
int m_width;
int m_height;
// HDIB m_hDIB_RECORD[5];
HDIB GetHDIB() const
{ return m_hDIB; }
CPalette* GetDocPalette() const
{ return m_palDIB; }
CSize GetDocSize() const
{ return m_sizeDoc; }
void ReplaceHDIB(HDIB hDIB)
{
//替换DIB ,在功能粘贴中用到该函数
//判断DIB是否为空
if(m_hDIB!=NULL)
{
::GlobalFree((HGLOBAL)m_hDIB);
}
//替换成新的DIB对象
m_hDIB=hDIB;
}
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CXread2Doc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
void InitDIBData();
virtual ~CXread2Doc();
HDIB m_hDIB;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
CPalette* m_palDIB;
CSize m_sizeDoc;
// Generated message map functions
protected:
//{{AFX_MSG(CXread2Doc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_XREAD2DOC_H__EB9CC0EF_710D_40F1_904F_2D957FD6D16A__INCLUDED_)