本文整理汇总了C++中CLine::Draw方法的典型用法代码示例。如果您正苦于以下问题:C++ CLine::Draw方法的具体用法?C++ CLine::Draw怎么用?C++ CLine::Draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLine
的用法示例。
在下文中一共展示了CLine::Draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDocument
void CMy010_SDIView::OnDraw(CDC* pDC)
{
CMy010_SDIDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: add draw code for native data here
// Get the number of lines in the document
int liCount = pDoc->GetLineCount();
// Are there any lines in the document?
if (liCount)
{
int liPos;
CLine *lptLine;
// Loop through the lines in the document
for (liPos = 0; liPos < liCount; liPos++)
{
// Get the from and to point for each line
lptLine = pDoc->GetLine(liPos);
// Draw the line
lptLine->Draw(pDC);
}
}
}
示例2: dc
void CMy010_SDIView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
// Check to see if the left mouse button is down
if ((nFlags & MK_LBUTTON) == MK_LBUTTON)
{
// Have we captured the mouse?
if (GetCapture() == this)
{
// Get the Device Context
CClientDC dc(this);
// Add the line to the document
CLine *pLine = GetDocument()->AddLine(m_ptPrevPos, point);
// Draw the current stretch of line
pLine->Draw(&dc);
// Save the current point as the previous point
m_ptPrevPos = point;
}
}
CView::OnMouseMove(nFlags, point);
}