3维鼠标悬停显示当前坐标

秦少6666 2017-03-30 09:02:17
用surface的画的三维图,想把鼠标放上去就显示当前坐标值*(X、Y、Z),抄网上的一点不行,只是抄了代码,哪里还需要设置么?
void CIsosurfaceDlg::OnOnMouseMoveTchart1(long Shift, long X, long Y)
{
// TODO: Add your control notification handler code here
int mPoint = -1;
double xValue = m_chart1.Series(0).XScreenToValue(X) ; //+ 0.5
mPoint = (int)(xValue);
if(mPoint < 0)
{
return ;
}
CValueList xList = m_chart1.Series(0).GetXValues();
CValueList yList = m_chart1.Series(0).GetYValues();
CString strXLabel = m_chart1.Series(0).GetPointLabel(mPoint);
int dYLabel = (int)yList.GetValue(mPoint);
CToolList tlist = m_chart1.GetTools();
CTools tools = tlist.GetItems(1);
CAnnotationTool anntool = tools.GetAsAnnotation();
CString strTopNote;
strTopNote.Format("Time: %ss Temperature: %3d",strXLabel, dYLabel);
anntool.SetText(strTopNote);
}
...全文
941 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
秦少6666 2017-07-26
  • 打赏
  • 举报
回复
为什么没有回复

703

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder ActiveX/COM/DCOM
社区管理员
  • ActiveX/COM/DCOM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧