picturectrl.h

来自「SQLBig5BugTool 宽字符操作问题」· C头文件 代码 · 共 59 行

H
59
字号

//PictureCtrl.h

#ifndef _PictureCtrl_
#define _PictureCtrl_

////////////////////////////////////////////////////////////////
// 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 "picture.h"
//#include "StatLink.h"
#pragma once

//////////////////
// Class to encapsulate IPicture. This does not wrap all IPicture methods,
// only the ones I needed to implement ImgView -- feel free to add the others
// yourself.
//
class CPictureCtrl : public CStatic 
{
public:
	CPictureCtrl(BOOL bAutoLoadImage=TRUE);
	~CPictureCtrl();

	// brainless wrappers call CPicture
	BOOL LoadImage(UINT nIDRes) ;

	BOOL LoadImage(LPCTSTR pszPathName);

	BOOL LoadImage(CArchive& ar);

	BOOL LoadImage(IStream* pstm);

	CSize GetImageSize() ;

	const CPicture* GetPicture() ;

protected:
	CPicture m_pict;			// picture
	BOOL m_bAutoLoadImage;	// automatically load image w/same Ctrl ID
	
protected:
	virtual void PreSubclassWindow();

	// message handlers
	afx_msg void OnPaint();
	afx_msg int  OnCreate(LPCREATESTRUCT lpcs);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);

	DECLARE_DYNAMIC(CPictureCtrl)
	DECLARE_MESSAGE_MAP()
private:
	void OnLoadImageSuccess();
};

#endif

⌨️ 快捷键说明

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