void CMfcDrawingTestDlg::OnBnClickedOk()
{
double x,y,x0,y0;
double pi = 3.14159254;
CString sa;
CString sx;
CString so;
double da;
double dx;
double doo;
CEdit* ceA = (CEdit*)GetDlgItem(IDC_TXTA);
CEdit* ceX = (CEdit*)GetDlgItem(IDC_TXTX);
CEdit* ceO = (CEdit*)GetDlgItem(IDC_TXTO);
ceA->GetWindowTextW(sa);
ceX->GetWindowTextW(sx);
ceO->GetWindowTextW(so);
da = _wtof(sa.GetBuffer());
dx = _wtof(sx.GetBuffer());
doo = _wtof(so.GetBuffer());
CEdit* ce = (CEdit*)GetDlgItem(IDC_EDIT1);
CClientDC dc(ce);
CPen* pen = new CPen(PS_SOLID,1,1);
CPen* poldPen = dc.SelectObject(pen);
for(x = 1;x < 360;x++){
x0 = x-1;
y0 = da*sin(x0/doo) + dx;da,振幅,doo, X偏移量 dx, y偏移量
y = da*sin(x/doo) + dx;
dc.MoveTo(x0,y0);
dc.LineTo(x,y);
}
// TODO: Add your control notification handler code here
//OnOK();
}
void CMfcDrawingTestDlg::OnBnClickedCancel()
{
Invalidate();清除
// TODO: Add your control notification handler code here
//OnCancel();
}