一个问题求助,关于MoveTo()和LineTo()的;怎么解决;;;大虾门帮一下忙;严重感谢
void CHermiteView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
int i;
if(m_nCount==0)
{
CClientDC dc(this);
CPen pen,*oldpen;
pen.CreatePen(PS_SOLID,5,RGB(255,180,0));
oldpen=dc.SelectObject(&pen);
hermite_to_points(ptControlPts,ptPts,npoints);
dc.MoveTo(ptPts[0]);
//dc.MoveTo(ptPts[npoints+1].x,ptPts[npoints+1].y);
for (i=1;i<npoints;i++)
{
dc.LineTo(ptPts[i]);
}
dc.SelectObject(oldpen);
}
CView::OnRButtonUp(nFlags, point);
}
void CHermiteView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (m_nCount>0 && m_nCount<=N && m_nCount%2==1)
{
CClientDC dc(this);
dc.SetROP2(R2_NOT);
dc.MoveTo((CPoint)ptControlPts[m_nCount-1]);
dc.LineTo(m_Newpoint);
dc.MoveTo((CPoint)ptControlPts[m_nCount-1]);
dc.LineTo(point);
m_Newpoint=point;
}
CView::OnMouseMove(nFlags, point);
}:\Hermite\HermiteView.cpp(168) : error C2664: “CPoint CDC::MoveTo(POINT)” : 不能将参数 1 从“Point”转换为“POINT”
无构造函数可以接受源类型,或构造函数重载决策不明确
f:\Hermite\HermiteView.cpp(172) : error C2664: “BOOL CDC::LineTo(POINT)” : 不能将参数 1 从“Point”转换为“POINT”
无构造函数可以接受源类型,或构造函数重载决策不明确
f:\Hermite\HermiteView.cpp(187) : error C2440: “类型转换” : 无法从“Point”转换为“CPoint”
无构造函数可以接受源类型,或构造函数重载决策不明确
f:\Hermite\HermiteView.cpp(189) : error C2440: “类型转换” : 无法从“Point”转换为“CPoint”
无构造函数可以接受源类型,或构造函数重载决策不明确
自己转换咯,如下,没试过
POINT p=new POINT()
p.x=ptPts[0].x
p.y=ptPts[0].y
可以用继承来实现