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

📄 bmpcompressdlg.h

📁 本源码是用VC++6.0实现的
💻 H
字号:
// BmpCompressDlg.h : header file
//

#if !defined(AFX_BMPCOMPRESSDLG_H__F2C6A525_1ED1_4C6B_9A62_72C6A77151E3__INCLUDED_)
#define AFX_BMPCOMPRESSDLG_H__F2C6A525_1ED1_4C6B_9A62_72C6A77151E3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CBmpCompressDlg dialog
#include "Dib.h"

class CBmpCompressDlg : public CDialog
{
// Construction
public:
	CBmpCompressDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CBmpCompressDlg)
	enum { IDD = IDD_BMPCOMPRESS_DIALOG };
	CSliderCtrl	m_scale;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBmpCompressDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
//	char  strFileName[256];

	// Generated message map functions
	//{{AFX_MSG(CBmpCompressDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnLoad();
	afx_msg void OnCompress();
	afx_msg void OnDecompress();
	afx_msg void OnOutofmemoryScaleDisplayBMP(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnReleasedcaptureScale(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDisplay();//显示位图
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	CPalette * CreateBitmpPalette(CDib * pBitmap); //创建调色板
	void OnDrawBMP(); //显示位图图片
	void OnHideBMP();//隐藏位图
	void OnDrawTEXT(CString &strTitle); //显示文件信息
	void OnUpdateClient(int nIDDlgItem);//刷新客户区
	BOOL CompressBMP(CFile & dibfile);//压缩位图
	BOOL DeCompressBmp(CFile & dibfile);//解压缩成位图
private:
	CPalette *m_hPalette;
	CDib  m_Dib;
	CFile m_CompressFile;//压缩后的文件
	char m_compressionRatio[10];//文件压缩比
	float m_ratio;//图像显示比
	CString m_filename;//显示的文件名
	UINT m_bfsize;//显示得文件大小
	UINT m_numberofcolor;//显示的颜色位数
	
};

//DAT文件头结构
typedef struct{
		 BYTE bManufacturer;
		 BYTE bVersion;
		 WORD wWidth;
		 WORD wHeight;
		 UINT numberOfColor;	
		 DWORD biSizeImage;//图像实际大小
		 UINT iWay;//压缩的扫描方式(iWay=0--按行,iWay=1--按列,iWay=2--按三角)
		 BYTE identify;//游程标志
} DATHEADER;

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

#endif // !defined(AFX_BMPCOMPRESSDLG_H__F2C6A525_1ED1_4C6B_9A62_72C6A77151E3__INCLUDED_)

⌨️ 快捷键说明

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