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

📄 view.h

📁 在MFC应用程序中根据自己的选择显示一个JPG图形文件
💻 H
字号:
////////////////////////////////////////////////////////////////
// MSDN Magazine -- October 2001
// If this code works, it was written by Paul DiLascia.
// If not, I don't know who wrote it.
// Compiles with Visual C++ 6.0 for Windows 98 and probably Windows 2000 too.
// Set tabsize = 3 in your editor.
//
#include "Doc.h"

/////////////////
// Picture view is a typical scroll view.
//
class CPictureView : public CScrollView {
public:
	virtual ~CPictureView();
	CPictureDoc* GetDocument() { return (CPictureDoc*)m_pDocument; }

protected:
	BOOL m_rcImage;		// rect to display image in
	UINT m_iHowScale;		// how to scale image

	CPictureView();
	void GetImageRect(CRect& rc);
	void SetScrollSizes();

	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual void OnInitialUpdate(); // called first time after construct

	// command/message handlers
	afx_msg void OnViewScale(UINT nID);
	afx_msg void OnUpdateViewScale(CCmdUI* pCmdUI);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnSize(UINT nType, int cx, int cy);

	DECLARE_DYNCREATE(CPictureView)
	DECLARE_MESSAGE_MAP()
};

⌨️ 快捷键说明

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