在MFC环境中绘制正弦曲线的函数 不明白
CDC*pDC=GetDC();CPenNewPen;NewPen.CreatePen(PS_SOLID,2,RGB(255,0,0));CPen*pOldPen=pDC...
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();
dy=(yCenter-20)*sin(i*4*3.14159/(nRight-45));这个式子的具体解释 一定具体点 我特别想明白一下 谢谢 展开
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();
dy=(yCenter-20)*sin(i*4*3.14159/(nRight-45));这个式子的具体解释 一定具体点 我特别想明白一下 谢谢 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询