void MTracker::Draw( CDC* pDC ) const
{
CRect rect;
//绘制矩形的轮廓线跟踪
CRectTracker::Draw(pDC); //直线
if((type == MLineType) && ((m_nStyle & (resizeInside|resizeOutside))!=0))
{
//返回一个CRectTracker项的调整大小把手的掩码。 UINT mask = GetHandleMask();
for (int i = 0; i < 8; ++i)
{
if (mask & (1<<i))
{
int p1, p2;
//左上+右下
if(leftBottomRightUp == 0)
{
p1 = 1, p2 = 4;
}
//左下+右上
else
{
p1 = 2, p2 = 8;
}
if( ((1<<i) == p1) || ((1<<i) == p2))
{
GetHandleRect((TrackerHit)i, &rect);
//画黑框
pDC->FillSolidRect(rect, RGB(0, 0, 0));
}
else
{
GetHandleRect((TrackerHit)i, &rect);
//画白框
pDC->FillSolidRect(rect, RGB(255, 255, 255));
}
}
}
}}
上面的注释我自己添加的,不过还是没有弄懂上面是什么意思,MTracker继承自CRectTracker,