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

📄 rollfontview.cpp

📁 本压缩软件为《Visual C++6.0基础教程》(黑魔方系列)一书的源代码
💻 CPP
字号:
// RollFontView.cpp : implementation of the CRollFontView class
//

#include "stdafx.h"
#include "RollFont.h"

#include "RollFontDoc.h"
#include "RollFontView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CRollFontView

IMPLEMENT_DYNCREATE(CRollFontView, CView)

BEGIN_MESSAGE_MAP(CRollFontView, CView)
	//{{AFX_MSG_MAP(CRollFontView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRollFontView construction/destruction

CRollFontView::CRollFontView()
{
	// TODO: add construction code here

}

CRollFontView::~CRollFontView()
{
}

BOOL CRollFontView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CRollFontView drawing

void CRollFontView::OnDraw(CDC* pDC)
{
	CRollFontDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
	CFont rotateFont[6];
	pDC->SetTextColor(RGB(240,100,250));
	for ( int i =0; i<6; i++)
	{
	rotateFont[i].CreateFont ( 27, 0, i*600, 0,FW_NORMAL, 
false, false, false, DEFAULT_CHARSET, OUT_DEVICE_PRECIS, 
	CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,DEFAULT_PITCH, "华文彩云");
	CFont* pOldFont = (CFont *)pDC->SelectObject ( & rotateFont[i] );
	pDC->TextOut ( 250, 200, "    旋转字体实例");
	pDC->SelectObject ( pOldFont );
	}

}

/////////////////////////////////////////////////////////////////////////////
// CRollFontView diagnostics

#ifdef _DEBUG
void CRollFontView::AssertValid() const
{
	CView::AssertValid();
}

void CRollFontView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CRollFontDoc* CRollFontView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CRollFontDoc)));
	return (CRollFontDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CRollFontView message handlers

⌨️ 快捷键说明

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