void CMyView::OnDraw(CDC* pDC)
{
CMyDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRect rect;
GetClientRect(rect);
pDC->Ellipse(rect.Width()/2-200,rect.Height()/2-200,rect.Width()/2+200,rect.Height()/2+200);
LOGFONT lf;
CFont font;
CFont *oldFont;
lf.lfHeight=40;
lf.lfWeight=10;
lf.lfEscapement=m_dEscapement;
lf.lfOrientation=m_dOrientation;
lf.lfWeight=300;
lf.lfItalic=FALSE;
lf.lfUnderline=FALSE;
lf.lfStrikeOut=FALSE;
lf.lfCharSet=ANSI_CHARSET;
lf.lfOutPrecision=OUT_STROKE_PRECIS;
lf.lfClipPrecision=CLIP_STROKE_PRECIS;
lf.lfQuality=DRAFT_QUALITY;
lf.lfPitchAndFamily=VARIABLE_PITCH|FF_MODERN;
strcpy(lf.lfFaceName,"仿宋_GB2312");
font.CreateFontIndirect(&lf);
oldFont=pDC->SelectObject(&font);
pDC->TextOut(rect.Width()/2,rect.Height()/2,"-->---------:)");
pDC->SelectObject(oldFont);
}
int CMyView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
SetTimer(1,1000,NULL);
return 0;
}
void CMyView::OnDestroy()
{
KillTimer(1);
// TODO: Add your message handler code here
}
void CMyView::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
m_dEscapement=m_dEscapement-100;//顺时钟转
m_dOrientation=m_dOrientation-100;
Invalidate();
CView::OnTimer(nIDEvent);
}