我感觉我这逻辑也没有错误呀,
void CPICSHOWView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (flag)//在点击漫游时flag设为true
{
m_beginp=point;//保存开始点
lbuttondown=TRUE;
}
CView::OnLButtonDown(nFlags, point);
}
void CPICSHOWView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (lbuttondown==TRUE&&flag==true)
{
CPoint p;
p.x=point.x-m_beginp.x;
p.y=point.y-m_beginp.y;
m_npoint.x = m_npoint.x+p.x;//设置图片显示的左上角坐标
m_npoint.y = m_npoint.y+p.y;
Invalidate();
}
CView::OnMouseMove(nFlags, point);
}
void CPICSHOWView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
lbuttondown==FALSE;
CView::OnLButtonUp(nFlags, point);
}
为什么点击漫游之后图片是可以移动,但是轨迹貌似有点问题,而且当响应OnLButtonUp之后移动一下鼠标图片就没了,这是为什么呀?还请懂的给小弟答复一下!
void CPICSHOWView::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (flag)//在点击漫游时flag设为true
{
m_beginp=point;//保存开始点
lbuttondown=TRUE;
}
CView::OnLButtonDown(nFlags, point);
}
void CPICSHOWView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (lbuttondown==TRUE&&flag==true)
{
CPoint p;
p.x=point.x-m_beginp.x;
p.y=point.y-m_beginp.y;
m_npoint.x = m_npoint.x+p.x;//设置图片显示的左上角坐标
m_npoint.y = m_npoint.y+p.y;
Invalidate();
}
CView::OnMouseMove(nFlags, point);
}
void CPICSHOWView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
lbuttondown==FALSE;
CView::OnLButtonUp(nFlags, point);
}
为什么点击漫游之后图片是可以移动,但是轨迹貌似有点问题,而且当响应OnLButtonUp之后移动一下鼠标图片就没了,这是为什么呀?还请懂的给小弟答复一下!
解决方案 »
- 数数 VS2008/VS2010 的毛病!
- 时间转换问题!
- 通过远程线程注入DLL,获取目标进程中窗口的窗口处理过程
- Hotthing(豪星),在吗,请问一个pablo ftp server的问题
- 列表控件问题!!有重谢!
- CString怎么不能在COM的接口下的方法里使用?
- 急!请高手一定帮忙
- 通过CoCreateInstance创建ActiveX,调用该ActiveX的某接口的Method的时候为什么总是出错?
- C++primer 中文doc版下载地址 20分一位,多给不限啊
- 右键菜单的一个小问题
- shell extesions编程-做一个explorer上的右键菜单,为什么Initialize时老是返回DV_E_FORMATETC错误!
- NDIS截获的数据包 为什么只能抓到udp的包 抓不到tcp??
p.y=point.y-m_beginp.y;后面加一句
m_beginp=point;
{
// TODO: Add your message handler code here and/or call default
if (flag)//在点击漫游时flag设为true
{
m_beginp=point;//保存开始点
lbuttondown=TRUE;}
//CView::OnLButtonDown(nFlags, point);调用父的函数似乎没什么意义,浪费CPU周期
}
void CPICSHOWView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (lbuttondown==TRUE&&flag==true)
{
int dx,dy;
dx=point.x-m_beginp.x;
dy=point.y-m_beginp.y; m_npoint.x = m_npoint.x+dx;//设置图片显示的左上角坐标
m_npoint.y = m_npoint.y+dy; m_beginp=point //为下次设置起始参照点 Invalidate();
}//CView::OnMouseMove(nFlags, point);
}void CPICSHOWView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
lbuttondown==FALSE;
//CView::OnLButtonUp(nFlags, point);
}
http://blog.csdn.net/xianglitian/article/details/6023656