/*******************************************************************************
函数名称 : Line
函数描述 : 荧光笔和画笔画线函数
输入参数 : StartPos 画线起点
输入参数 : EndPos 画线终点
返回值 : void
备注 : //[added by yangyiyi 2011-11-21]
*******************************************************************************/
void CEReadControl::Line(CPoint& StartPos, CPoint& EndPos)
{
CClientDC dc(this);
int iOldRop2 = dc.GetROP2();
CPen* pNewPen= NULL;
if (m_iPenType == 1)
{
pNewPen = new CPen(PS_SOLID, PEN_LINE_SIZE, m_rgbPenColor);
}
else if (m_iPenType == 2)
{
pNewPen = new CPen(PS_SOLID, HIGHLIGHT_LINE_SIZE, m_rgbHighlighterColor);
dc.SetROP2(R2_MASKPEN);
}
CPen* oldPen = dc.SelectObject(pNewPen);
dc.MoveTo(StartPos);
dc.LineTo(EndPos);
m_vecLines.back().vecPoints.push_back(EndPos);
dc.SelectObject(oldPen);
dc.SetROP2(iOldRop2);
pNewPen->DeleteObject();
delete pNewPen;
}