(3)矩形坐标反转函数
void CRectGraph::RectCoordinateReversal()
{
long lTx,lTy;
if ((m_Rect.left>m_Rect.right)&&(m_Rect.top>m_Rect.bottom))//在顶点处反转
{
lTx = m_Rect.left;
m_Rect.left = m_Rect.right;
m_Rect.right = lTx;
lTy = m_Rect.top;
m_Rect.top = m_Rect.bottom;
m_Rect.bottom = lTy;
}
if (m_Rect.left>m_Rect.right)//左右反转
{
lTx = m_Rect.left;
m_Rect.left = m_Rect.right;
m_Rect.right = lTx;
}
if (m_Rect.top>m_Rect.bottom)//上下反转
{
lTy = m_Rect.top;
m_Rect.top = m_Rect.bottom;
m_Rect.bottom = lTy;
}
}
(4)加载光标资源函数
void CRectGraph::RectAddCurResourse(CPoint point)
{
long lRet = JudgePositionInRect(point);
if ((lRet==SUBWIN_UP)||(lRet==SUBWIN_DOWN))
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZENS));
}
if ((lRet==SUBWIN_LEFT)||(lRet==SUBWIN_RIGHT))
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZEWE));
}
if ((lRet==SUBWIN_WN)||(lRet==SUBWIN_ES))
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZENWSE));
}
if ((lRet==SUBWIN_NE)||(lRet==SUBWIN_SW))
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZENESW));
}
if (lRet==SUBWIN_IN)
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_SIZEALL));
}
}
|