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

📄 photoshowview.h

📁 VS2005图像处理程序的源代码
💻 H
字号:
// photoshowView.h : CphotoshowView 类的接口
//


#pragma once


class CphotoshowView : public CView
{
	DECLARE_MESSAGE_MAP()
	DECLARE_DYNCREATE(CphotoshowView)
protected: // 仅从序列化创建
	CphotoshowView();

// 属性
public:
	CphotoshowDoc* GetDocument() const;

// 操作
public:
	BYTE*	m_pImageBuffer;				// 编辑图像原始像素数组
	BYTE*	m_pImageTempBuffer;			// 处理后的像素数组
	UINT	m_nPicWidth;				// 当前编辑图像宽度
	UINT	m_nPicHeight;				// 当前编辑图像高度
	UINT	m_nTempWidth;				// 处理后图像的宽度
	UINT	m_nTempHeight;				// 处理后图像的高度
public:
	virtual void OnDraw(CDC* pDC);  // 重写以绘制该视图
	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);

// 实现
public:
	bool	m_bWidhtOut;				// 显示图像是否超出视图宽度
	bool	m_bHeightOut;				// 显示图像是否超出视图高度
//	int		m_nShowType;				// 显示类型
	virtual ~CphotoshowView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// 生成的消息映射函数
protected:

public:
	afx_msg void OnFileOpen();
public:
	void OpenFile(const CString& strPath);
	/***************************************************************************
	*	作用:		获得指定索引文件的全路径
	***************************************************************************/
	CString GetFilePath(int nIndex)
	{
		ASSERT(nIndex >= 0 && nIndex < m_nPicNum);
		return m_strPath + L"\\" + m_FilesNameAry[nIndex];
	}
private:
	CStringArray	m_FilesNameAry;		// 保存当前目录下所有文件名的容器
	CString			m_strPath;			// 当前打开目录
	int				m_nPos;				// 当前文件在容器中的索引
	int				m_nEffectDisplayType;// 当前特效类型
	bool			m_bEffectDraw;		// 是否使用特效显示
	Bitmap*			m_pBitmap;			// 双缓存绘图
	int				m_nPicNum;			// 当前目录的文件个数
	int				m_nShowPicHeight;	// 显示图片的高度
	int				m_nShowPicWidth;	// 显示图片的宽度
	int				m_nXX;				// 图片X坐标的偏移量
	int				m_nYY;				// 图片Y坐标的偏移量
	CPoint			m_psMove;			// 记录移动前鼠标的位置
	int				m_nXXMax;			// X坐标最大偏移量
	int				m_nYYMax;			// Y坐标最大偏移量
private:
	void PreDrawImage(void);
	bool GetImageBuffer(CString& strPath);// 将指定路径的图像信息提取到数组中j 
	void FreeImageBuffer(void);			// 释放图像信息占用的内存
	void ResetImage();
	void WriteBufferToBMP(BYTE *im_buffer, WORD X_bitmap, WORD Y_bitmap, const char* BMPname);
private:
	void EffectDisplayImage(CDC* pDC, CDC* pMemDC);
	void ShowPicture(CDC* pDC, Image& image);
public:
	CSize GetShowPicSize(Image& image);
public:
	afx_msg void OnEffectNone();
	afx_msg void OnEffectRand();
	afx_msg void OnEffectScandown();
	afx_msg void OnEffectVscan();
	afx_msg void OnEffectMoveright();
	afx_msg void OnEffectHsmvoe();
	afx_msg void OnEffectVblind();
	afx_msg void OnEffectSblind();
	afx_msg void OnEffectVraster();
	afx_msg void OnEffectHraster();
	afx_msg void OnEffectMosaic();
	afx_msg void OnEffectRaindrop();
	afx_msg void OnUpdateEffectNone(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectRand(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectScandown(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectVscan(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectMoveright(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectHsmvoe(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectVblind(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectSblind(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectVraster(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectHraster(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectMosaic(CCmdUI *pCmdUI);
	afx_msg void OnUpdateEffectRaindrop(CCmdUI *pCmdUI);
public:
//	afx_msg void OnMove(int x, int y);
public:
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	void FixOffset(void);
	afx_msg void OnPointHistogram();
	afx_msg void OnPointLinetran();
	afx_msg void OnFileSave();
	afx_msg void OnPointLog();
	afx_msg void OnPointThreshold();
	afx_msg void OnPointEqualize();
	afx_msg void OnGeoMove();
	afx_msg void OnGeoMirror();
	afx_msg void OnGeoZoom();
	afx_msg void OnGeoRotate();
	afx_msg void OnImproveSmooth();
	afx_msg void OnImproveSmoothg();
	afx_msg void OnImproveMedian();
	afx_msg void OnImproveSharp();
	afx_msg void OnImproveSobel();
public:
	afx_msg void OnFilterNegative();
public:
	afx_msg void OnFilterEmboss();
public:
	afx_msg void OnFilterBw();
public:
	afx_msg void OnFilterMosaic();
public:
	afx_msg void OnFilterSketch();
};

#ifndef _DEBUG  // photoshowView.cpp 中的调试版本
inline CphotoshowDoc* CphotoshowView::GetDocument() const
   { return reinterpret_cast<CphotoshowDoc*>(m_pDocument); }
#endif

⌨️ 快捷键说明

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