急求~~MFC画图问题,以前就是这样画的,这次怎么画不出了。。。
急啊,期末了,你懂得~~~请各位大神帮帮忙啊~~~~
以下为View里的两个相关函数:
void CClusterView::DrawKmeans(Data data[] , int num ,int k ,CDC *pDC)
{
pDC->SetViewportOrg(150,330);
pDC->MoveTo (-100,0);
pDC->LineTo (800,0);
pDC->MoveTo (0,300);
pDC->LineTo (0,-300);
}
void CClusterView::Kmeans()
{
CDlgCalculate d;
if(d.DoModal()==IDCANCEL)
return;
else if(d.DoModal()==IDOK)
{
CDC *pDC;
pDC=GetDC();
pDC->SetViewportOrg(150,330);
this->DrawKmeans(d.data ,d.num ,d.m_k ,pDC);
}
}
以下为View里的两个相关函数:
void CClusterView::DrawKmeans(Data data[] , int num ,int k ,CDC *pDC)
{
pDC->SetViewportOrg(150,330);
pDC->MoveTo (-100,0);
pDC->LineTo (800,0);
pDC->MoveTo (0,300);
pDC->LineTo (0,-300);
}
void CClusterView::Kmeans()
{
CDlgCalculate d;
if(d.DoModal()==IDCANCEL)
return;
else if(d.DoModal()==IDOK)
{
CDC *pDC;
pDC=GetDC();
pDC->SetViewportOrg(150,330);
this->DrawKmeans(d.data ,d.num ,d.m_k ,pDC);
}
}
作者: kuaileliuyuan 发布时间: 2011-06-17
补充下,CDlgCalculate是我弄的一个对话框,data是我定义的一个类,data.x data.y都是整形
作者: kuaileliuyuan 发布时间: 2011-06-17