科目名稱:程式設計 | 開課系所:資訊工程 學系 | 任課教師 |
吳坤熹 |
||
系所別: |
年級: |
學號: |
姓名: |
考試日期 |
2011.5.18 |
(考試時間: 16:30-16:45)
void Ctest_drawView::OnDraw(CDC* pDC)
{
Ctest_drawDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
std::vector<CPoint> m_Points;
m_Points.push_back(CPoint(10,10));
m_Points.push_back(CPoint(20,20));
m_Points.push_back(CPoint(30,30));
m_Points.push_back(CPoint(40,40));
int k = m_Points.size()-1;
for (int i=0; i<=k/2; i++)
pDC->Rectangle(m_Points[i].x, m_Points[i].y, m_Points[k-i].x, m_Points[k-i].y);
}
void Ctest_drawView::OnDraw(CDC* pDC)
{
Ctest_drawDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
std::vector<CPoint> m_Points;
m_Points.push_back(CPoint(10,10));
m_Points.push_back(CPoint(20,20));
m_Points.push_back(CPoint(30,30));
m_Points.push_back(CPoint(40,40));
m_Points.push_back(CPoint(50,50));
int k = m_Points.size()-1;
for (int i=0; i<=k/2; i++)
pDC->Ellipse(m_Points[i].x, m_Points[i].y, m_Points[k-i].x, m_Points[k-i].y);
}