mfc 画图问题,在线等待,问什么运行后只有两条曲线啊!谢谢啦~!
intnum1,num2,num3;CStringstr1,str2,str3;GetDlgItemText(L1,str1);//获取控件方法1GetDlgItemTe...
int num1,num2,num3;
CString str1,str2,str3;
GetDlgItemText(L1,str1);//获取控件方法1
GetDlgItemText(XL,str2);
GetDlgItemText(power,str3);
num1= _tstoi( LPCTSTR(str1) );
num2= _tstoi( LPCTSTR(str2) );
num3= _tstoi( LPCTSTR(str3) );
CWnd *pWnd=GetDlgItem(IDC_STATIC1);
CDC *pControlDC=pWnd->GetDC();
pWnd->Invalidate();
pWnd->UpdateWindow();
pControlDC->SelectStockObject(BLACK_BRUSH);
// pControlDC->LineTo(0,num2);
for(i=2;i<num1;i++)
{
X= (i-2)/(num1-2);
X=X^num3;
X=X*num2;
pControlDC->MoveTo(0,X);
pControlDC->LineTo(num2,X);
}
pWnd->ReleaseDC(pControlDC);
} 展开
CString str1,str2,str3;
GetDlgItemText(L1,str1);//获取控件方法1
GetDlgItemText(XL,str2);
GetDlgItemText(power,str3);
num1= _tstoi( LPCTSTR(str1) );
num2= _tstoi( LPCTSTR(str2) );
num3= _tstoi( LPCTSTR(str3) );
CWnd *pWnd=GetDlgItem(IDC_STATIC1);
CDC *pControlDC=pWnd->GetDC();
pWnd->Invalidate();
pWnd->UpdateWindow();
pControlDC->SelectStockObject(BLACK_BRUSH);
// pControlDC->LineTo(0,num2);
for(i=2;i<num1;i++)
{
X= (i-2)/(num1-2);
X=X^num3;
X=X*num2;
pControlDC->MoveTo(0,X);
pControlDC->LineTo(num2,X);
}
pWnd->ReleaseDC(pControlDC);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询