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

📄 testmatcom_imageview.h

📁 《精通matlab与c++混合编程》的光盘内容
💻 H
字号:
// testmatcom_imageView.h : interface of the CTestmatcom_imageView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_TESTMATCOM_IMAGEVIEW_H__C34BC76B_E954_46E8_BAFF_CAF5802EC3BD__INCLUDED_)
#define AFX_TESTMATCOM_IMAGEVIEW_H__C34BC76B_E954_46E8_BAFF_CAF5802EC3BD__INCLUDED_

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

#include "matlib.h"

class CTestmatcom_imageView : public CView
{
protected: // create from serialization only
	CTestmatcom_imageView();
	DECLARE_DYNCREATE(CTestmatcom_imageView)

// Attributes
public:
	CTestmatcom_imageDoc* GetDocument();

// Operations
public:
	bool isInit; //MATCOM初始化标志
	Mm m_h; //用于显示图像的句柄
	Mm m_data, m_map;// 读入图像的数据和调色板数据

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTestmatcom_imageView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	//24位真彩图像到灰度图像的转换函数
	void rgb2gray(Mm &m_data,Mm &m_outData);
	//判断图像句柄是否有效
	bool IsMatcomHandleValid(Mm handle);
	//将CString类型的字符转换为Mm类型的字符串
	void ChangeStrToMm(Mm &mstring, CString instring);

	virtual ~CTestmatcom_imageView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CTestmatcom_imageView)
	afx_msg void OnFileOpen();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnFft();
	afx_msg void OnLargeToSmall();
	afx_msg void OnSmallToLarge();
	afx_msg void OnReset();
	afx_msg void OnCool();	
	afx_msg void OnGray();
	afx_msg void OnJet();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in testmatcom_imageView.cpp
inline CTestmatcom_imageDoc* CTestmatcom_imageView::GetDocument()
   { return (CTestmatcom_imageDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_TESTMATCOM_IMAGEVIEW_H__C34BC76B_E954_46E8_BAFF_CAF5802EC3BD__INCLUDED_)

⌨️ 快捷键说明

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