picture.h

来自「全屏显示的VC++源代码,简单实用。代码用VC++6.0编写。」· C头文件 代码 · 共 43 行

H
43
字号
////////////////////////////////////////////////////////////////
// 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.
//
#pragma once
//////////////////
// Picture object based on GDI+ Image class
//
class CPicture {
public:
	CPicture();
	~CPicture();

	// Load frm various sosurces
	BOOL Load(UINT nIDRes);
	BOOL Load(LPCTSTR pszPathName);
//	BOOL Load(CFile& file);
//	BOOL Load(CArchive& ar);
	BOOL Load(IStream* pstm);

	// render to device context
	BOOL Render(CDC* pDC, CRect rc=CRect(0,0,0,0)) const;

	CSize GetImageSize(CDC* pDC=NULL) const;


	operator BOOL() {
		return m_pImage!=NULL;
	}
	Image* GetImage() {
		return m_pImage;
	}

	void Rotate(RotateFlipType rft);
	void Free();

	BOOL m_bUseEmbeddedColorManagement;	     // set this before loading
	Image* m_pImage;						 // GDI+ Image object
	HGLOBAL m_hMem;							 // used for resource image
};

⌨️ 快捷键说明

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