c++mfc编程画sin图像 255
I:\c++实践\1006150133\1006150133View.cpp(149):errorC2064:termdoesnotevaluatetoafunction...
I:\c++实践\1006150133\1006150133View.cpp(149) : error C2064: term does not evaluate to a functionvoid CMy1006150133View::OnSinx()
{
// TODO: Add your command handler code here
CDC *pDC=GetDC();
CPen NewPen;
NewPen.CreatePen(PS_SOLID,2,RGB(255,0,0));
CPen *pOldPen=pDC->SelectObject(&NewPen);
pDC->MoveTo(20,yCenter);
int y,x;
double dy;
for(int i=5;i<nRight;i+=5)
{ x=20+i;
dy=(yCenter-20)*sin(i*4*3.14159/(nRight-45));
y=yCenter-(int)dy;
pDC->LineTo(x,y);
pDC->MoveTo(x,y);
}
pDC->SelectObject(pOldPen);
NewPen.DeleteObject();
}
错误行在引用sin函数那里,怎么办。明天就要交,着急
dy=(yCenter-20)*sin(i*4*3.14159/(nRight-45));
问题在这行 展开
{
// TODO: Add your command handler code here
CDC *pDC=GetDC();
CPen NewPen;
NewPen.CreatePen(PS_SOLID,2,RGB(255,0,0));
CPen *pOldPen=pDC->SelectObject(&NewPen);
pDC->MoveTo(20,yCenter);
int y,x;
double dy;
for(int i=5;i<nRight;i+=5)
{ x=20+i;
dy=(yCenter-20)*sin(i*4*3.14159/(nRight-45));
y=yCenter-(int)dy;
pDC->LineTo(x,y);
pDC->MoveTo(x,y);
}
pDC->SelectObject(pOldPen);
NewPen.DeleteObject();
}
错误行在引用sin函数那里,怎么办。明天就要交,着急
dy=(yCenter-20)*sin(i*4*3.14159/(nRight-45));
问题在这行 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询