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

📄 bitmapbox.h

📁 c++系统开发实例精粹内附的80例源代码 环境:windows2000,c++6.0
💻 H
字号:
//////////////////////////////////////////////////////////////////////
// FileFury
// Copyright (c) 2000 Tenebril Incorporated
// All rights reserved.
//
// This source code is governed by the Tenebril open source
// license (http://www.tenebril.com/developers/opensource/license.html)
//
// For more information on this and other open source applications,
// visit the Tenebril OpenSource page:
//       http://www.tenebril.com/developers/opensource
//
//////////////////////////////////////////////////////////////////////

#ifndef CBITMAPBOX_DEFINE
#define CBITMAPBOX_DEFINE

class CBitmapBox : public CButton
{
public:
	CBitmapBox();
	~CBitmapBox();

	BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
		UINT BitmapID, CSize bmpSize);

	void SetBitmap(UINT BitmapID);
	void SetBitmap(char *BitmapName, bool IsResource = true, bool Tiling = false);

protected:

	virtual void DrawItem(LPDRAWITEMSTRUCT DrawItemStruct);

private:
	WORD m_wParseStyle;
	CBitmap *BackBitmap;
	bool InitBackDC, Tiling;
	CDC BackDC;
	CSize BitmapSize;
	COLORREF BackColor;
	bool ShowBitmap;

	BOOL LoadBMPImage(LPCTSTR sBMPFile, CBitmap& bitmap, CPalette *pPal, 
		CSize *BmpSize);

	DECLARE_MESSAGE_MAP()
};

class CBackBitmapBox : public CButton
{
public:
	CBackBitmapBox();
	~CBackBitmapBox();

	BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
		LPCTSTR BmpID, CSize bmpSize, COLORREF BackgroundColor);
	BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, 
		UINT BmpID, CSize bmpSize, COLORREF BackgroundColor);

protected:

	virtual void DrawItem(LPDRAWITEMSTRUCT DrawItemStruct);

private:
	WORD m_wParseStyle;
	CBitmap BackBitmap;
	bool InitBackDC;
	CDC BackDC;
	CSize BitmapSize;
	COLORREF BackColor;
	COLORREF OriginalImageBackground;

	BOOL LoadBMPImage(LPCTSTR sBMPFile, CBitmap& bitmap, CPalette *pPal, 
		CSize *BmpSize);

	DECLARE_MESSAGE_MAP()
};

class CFontPreviewBox : public CButton
{
public:
	CFontPreviewBox();
	~CFontPreviewBox();

	BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);

	void SetFont(LOGFONT font);

protected:

	virtual void DrawItem(LPDRAWITEMSTRUCT DrawItemStruct);

private:
	WORD m_wParseStyle;
	LOGFONT LogFont;

	DECLARE_MESSAGE_MAP()
};

#endif

⌨️ 快捷键说明

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