画出一个矩形,像visio那样选择它,通过拖动其顶点以实现矩形的拉伸,如何实现?
解决方案 »
- 游戏中的验证码识别,需要哪些知识才能识别出呢?
- 散分:学完了c/c++/mfc/stl,我能做些什么?
- 一个基于对话框的空工程,在对话框之间切换时内存每次都增加,最后内存泄露
- 急,我想开发一个管理软件,给个相关参考资料
- 请教:日期获取代码的错误
- 用m_pRecordset=theApp.m_pConnection->Execute((_bstr_t)strSQL,&vRowsAffected,adCmdText);怎么样判断m_pRecordset有无查询记录?
- 求助(vc6.0)编译dll出错
- 能否在外地参与软件开发
- 请问:对于用CreateProcess建立的进程,如何能够知道该进程所使用的内存量?
- OCX控件服务器访问的问题!
- 求助:注册组件的时候报错:行:1;字符:1;错误:类型不匹配:'MZ';代码:800A000D;源:Microsoft VBScript运行时错误.
- 在建立vc 工程的时候选择了生成hlp 文件。我把我的工程放到别的机器上的时候有如下的错误
void CPWnd::OnLButtonDown(UINT nFlags, CPoint point)
{// Text_Hit_Text(point);
// TODO: Add your message handler code here and/or call default
if(!m_iPos)
Text_Hit_Text(point);
else
{//已选择了
if(m_sTr.HitTest(point) == -1)
{//MessageBox("abc");
m_iPos = 0;
}
else
Position_Text(point);
Invalidate();
// CWnd::OnLButtonDown(nFlags, point);
/// return;
}
SetFocus();
if(m_iPos)
{
if(m_sTr.HitTest(point) == -1)
{
m_iPos = 0;
}
else
Position_Text(point);
Invalidate();
CWnd::OnLButtonDown(nFlags, point);
return;
}
CWnd::OnLButtonDown(nFlags, point);
}void CPWnd::Position_Text(CPoint point)
{
// Start tracking the tracker rectangle.
// Note that this function, CRectTracker::Track(), interacts with CRectTracker::AdjustRect().
// See our CGraphTracker class for the interaction.
if (m_sTr.Track(this, point, false,this))
{
// Update our new tracker rectangle dimensions.
m_newRect.right = m_sTr.m_rect.right;//-nXOffset;
m_newRect.left = m_sTr.m_rect.left;//-nXOffset;
m_newRect.top = m_sTr.m_rect.top;//-nXOffset;
m_newRect.bottom = m_sTr.m_rect.bottom;//-nXOffset;
m_tRect.CopyRect(&m_newRect);
m_iSChange=true;//m_iPos = 0;
// Invalidate();
}
}BOOL CPWnd::Text_Hit_Text(CPoint point)
{
if(m_sTr.HitTest(point) == CRectTracker::hitMiddle)
{// Set the postion flag and draw the tracker rectangle border
m_iPos=1;
CClientDC dc(this);
dc.LPtoDP(m_sTr.m_rect);
m_sTr.Draw(&dc);
Invalidate();
return TRUE;
}
return FALSE;
}void CPWnd::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
Text_Hit_Text(point);
CWnd::OnLButtonDblClk(nFlags, point);
}
当然要像我程序里边哪样的话,还得稍加修改。http://shixie.topcities.com