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

📄 demownd.h

📁 哈夫曼编码解码演示程序
💻 H
字号:
#if !defined(AFX_DEMOWND_H__3111B750_DA28_4B8C_B9C1_FE50985AF8B5__INCLUDED_)
#define AFX_DEMOWND_H__3111B750_DA28_4B8C_B9C1_FE50985AF8B5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DemoWnd.h : header file
//
#include "huffmancode.h"
/////////////////////////////////////////////////////////////////////////////
// CDemoWnd window

class CDemoWnd : public CStatic
{
// Construction
public:
	CDemoWnd();
    void Attach(CHuffmanCode*pHuff);
	void detach();
	void LoadBmp(CString szBK,CString szNode,
		CString szNodeF,CString szLeaf,CString szLeafF);
	BOOL Calculate();
	void DrawTree(CDC*pDC);
	void DrawNode(CDC*pDC,int n);
    void DrawLine(CDC*pDC,int n,int x,int y);
	void DrawCode(CDC*pDC);
	void DrawTransparentBitmap(CBitmap *pBitmap, CDC* pDC,
		COLORREF crTrans,const CRect& rcDest,const CRect& rcSrc);
	void TransparentBlt(CDC *pSrcDC, CDC* pDestDC,COLORREF crTrans,
		const CRect& rcDest,const CRect& rcSrc);

//	void GetTreeRect(int n,CHuffNode*pNode,CRect &rect,
//		int &left,int &right);
	void AdjustTreePos(int n,int xDelt,int yDelt,int x,int y);
	void AdjustTreePos(int n,int xDelt,int yDelt,int x,int y,int &lDep,
							 int &rDep,int &Dep );
	int IsOverlap();
	int GetLevel(int n);
// Attributes
public:
	CHuffmanCode *m_pHuff;
	CBitmap m_bmpBK,m_bmpNode,m_bmpLeaf,
		m_bmpNodeF,m_bmpLeafF;
	CFont m_Font;
	CSize m_sizeNode,m_sizeBK;

	int m_xStart,m_yStart;//开始位置
	int m_Interval,m_xInterval,m_yInterval;//间隔
	int m_Radius;//半径
	float m_xScale,m_yScale;
	CRect m_rcDraw;

	COLORREF m_crNode;
	COLORREF m_crLeaf;
	COLORREF m_crLine;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDemoWnd)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CDemoWnd();

	// Generated message map functions
protected:
	//{{AFX_MSG(CDemoWnd)
	afx_msg void OnPaint();
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DEMOWND_H__3111B750_DA28_4B8C_B9C1_FE50985AF8B5__INCLUDED_)

⌨️ 快捷键说明

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