資源簡(jiǎn)介
自己寫(xiě)的一個(gè)畫(huà)圓程序,由于看不懂網(wǎng)上的那些畫(huà)圓算法,自己寫(xiě)了一個(gè),用畫(huà)點(diǎn)的函數(shù)畫(huà)一個(gè)圓,很簡(jiǎn)單,希望對(duì)大家有所幫助

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“tcycle.h“
#include?“math.h“
#include?“MainFrm.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
ON_WM_CREATE()
ON_COMMAND(IDX_DARAW?OnDaraw)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR???????????//?status?line?indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?construction/destruction
CMainframe::CMainframe()
{
//?TODO:?add?member?initialization?code?here
}
CMainframe::~CMainframe()
{
}
int?CMainframe::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
if?(CframeWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
if?(!m_wndStatusBar.Create(this)?||
!m_wndStatusBar.SetIndicators(indicators
??sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed?to?create?status?bar\n“);
return?-1;??????//?fail?to?create
}
return?0;
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?diagnostics
#ifdef?_DEBUG
void?CMainframe::AssertValid()?const
{
CframeWnd::AssertValid();
}
void?CMainframe::Dump(CDumpContext&?dc)?const
{
CframeWnd::Dump(dc);
}
#endif?//_DEBUG
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?message?handlers
void?CMainframe::OnDaraw()?
{
CClientDC?pDC(this);
int?x=100int?y=100int?r=50;
int?xiy1y2;
for(xi=x-r;xi<=x+r;xi++)
{
y1=y+(int)(sqrt(r*r-(x-xi)*(x-xi)));
y2=y-(int)(sqrt(r*r-(x-xi)*(x-xi)));
while(y2<=y1)
{
pDC.SetPixel(xiy2RGB(25500));
y2++;
}
}
}
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件???????1745??2009-03-05?16:56??tcycle\tcycle.clw
?????文件???????3996??2009-03-05?15:38??tcycle\ReadMe.txt
?????文件???????1356??2009-03-05?15:38??tcycle\tcycle.h
?????文件????????999??2009-03-05?15:38??tcycle\StdAfx.h
?????文件????????208??2009-03-05?15:38??tcycle\StdAfx.cpp
?????文件???????1475??2009-03-05?15:38??tcycle\tcycleDoc.h
?????文件???????1742??2009-03-05?15:38??tcycle\tcycleDoc.cpp
?????文件????????398??2009-03-05?15:38??tcycle\res\tcycle.rc2
?????文件???????1078??2009-03-05?15:38??tcycle\res\tcycleDoc.ico
?????文件???????1078??2009-03-05?15:38??tcycle\res\tcycle.ico
?????文件???????4487??2009-03-05?15:38??tcycle\tcycle.dsp
?????文件????????520??2009-03-05?15:38??tcycle\tcycle.dsw
?????文件??????58368??2009-03-05?16:57??tcycle\tcycle.ncb
?????文件?????214016??2009-03-05?16:45??tcycle\Debug\vc60.idb
?????文件???????5564??2009-03-05?15:51??tcycle\Debug\tcycle.res
?????文件????5483492??2009-03-05?15:39??tcycle\Debug\tcycle.pch
?????文件?????364544??2009-03-05?16:45??tcycle\Debug\vc60.pdb
?????文件?????105970??2009-03-05?15:39??tcycle\Debug\StdAfx.obj
?????文件??????15098??2009-03-05?15:39??tcycle\Debug\tcycleDoc.obj
?????文件?????345268??2009-03-05?16:45??tcycle\Debug\tcycle.ilk
?????文件?????114780??2009-03-05?16:45??tcycle\Debug\tcycle.exe
?????文件?????443392??2009-03-05?16:45??tcycle\Debug\tcycle.pdb
?????文件??????18813??2009-03-05?15:51??tcycle\Debug\tcycleView.obj
?????文件??????23128??2009-03-05?15:51??tcycle\Debug\tcycle.obj
?????文件??????20997??2009-03-05?16:45??tcycle\Debug\MainFrm.obj
?????文件???????1733??2009-03-05?15:38??tcycle\tcycleView.h
?????文件???????1844??2009-03-05?16:45??tcycle\tcycle.plg
?????文件???????2151??2009-03-05?15:49??tcycle\tcycleView.cpp
?????文件????????640??2009-03-05?15:49??tcycle\Resource.h
?????文件???????1438??2009-03-05?15:51??tcycle\MainFrm.h
............此處省略11個(gè)文件信息
- 上一篇:數(shù)值計(jì)算基礎(chǔ)
- 下一篇:中文16*16的字庫(kù)
評(píng)論
共有 條評(píng)論