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

📄 scmemdc.h

📁 Source code for EMFexplorer 1.0
💻 H
字号:
/*
*	This file is part of the EMFexplorer projet.
*	Copyright (C) 2004 Smith Charles.
*
*	This library is free software; you can redistribute it and/or
*	modify it under the terms of the GNU Lesser General Public
*	License as published by the Free Software Foundation; either
*	version 2.1 of the License, or (at your option) any later version.
*
*   This library is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
*   Lesser General Public License for more details.
*
*   You should have received a copy of the GNU Lesser General Public
*   License along with this library; if not, write to the Free Software
*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
*
*	Extension: for commercial use, apply the Equity Public License, which
*	adds to the normal terms of the GLPL a condition of donation to the author.
*   If you are interested in support for this source code,
*   contact Smith Charles <smith.charles@free.fr> for more information.
*/

#if !defined(AFX_SCMEMDC_H__790E5B99_35E2_4C34_B5E2_DA992D699D20__INCLUDED_)
#define AFX_SCMEMDC_H__790E5B99_35E2_4C34_B5E2_DA992D699D20__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define STGRAY_SCALE_NONE		0
#define STGRAY_SCALE_BW			2
#define STGRAY_SCALE_COARSE		4
#define STGRAY_SCALE_FINE		8

// static
BOOL SCRotateDC(HDC hDC, int iAngle, CRect rect, int iXPos, int iYPos, int& iGrOldMode);
BOOL SCUnRotateDC(HDC hDC, int iGrOldMode);
HDC SCGetAttribDC(HDC hDC);
//

class CSCMemDC : public CDC  
{
private:
	HBITMAP		m_hStockBM;		// to retore DC
	CBitmap		*m_pBmpMem;
	CPalette	*m_pPal;
	int			m_iWidth;
	int			m_iHeight;
	int			m_InitColor;
	int			m_iGrayScale;
	int			m_iGrMode;

public:
	CSCMemDC();
	virtual ~CSCMemDC();

	BOOL SCPrepareSurface(int width, int height, HENHMETAFILE hemf=NULL, COLORREF crBkColor=RGB(255, 255, 255));
	void SCCleanUp();
	int	SCGetWidth() {return m_iWidth;}
	int	SCGetHeight() {return m_iHeight;}
	HBITMAP STGetDCDIB() {  if (m_pBmpMem)
								return (HBITMAP)(*m_pBmpMem);
							return NULL;
						}
	CBitmap *SCDetachDIB();
	void SCSetGrayScale(int iGrayScale) {m_iGrayScale = iGrayScale;}
	BOOL SCShrinkSurface(CRect rc);
	BOOL SCResetSurfaceColor(int iColor);
	BOOL SCEraseBkgn();
	BOOL SCEraseBkgn(CBrush* pBrush);
	BOOL SCRotateDC(int iAngle, CRect rect, int iXPos, int iYPos);
	BOOL SCSelfRotate(int iAngle, CSize sizeDelta);
	BOOL SCUnRotateDC();
	BOOL SCRestoreOrigin(int iAngle, CRect rect, int iXPos, int iYPos);
};

#endif // !defined(AFX_SCMEMDC_H__790E5B99_35E2_4C34_B5E2_DA992D699D20__INCLUDED_)

⌨️ 快捷键说明

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