主题:帮帮忙!
这是一个棋盘的代码,运行无错误,但是没有结果,请帮我看一下是哪里出错?
CDC *pdc = m_mainboard.GetDC();
CRect rc ;
m_mainboard.GetClientRect(&rc);
CPen bi,*jbi;
bi.CreatePen(PS_DASH,2,RGB(248,162,247)); //创建黑色画笔
jbi=pdc->SelectObject(&bi);
int x = rc.right ;
int y = rc.bottom ;
int xx = rc.left ;
int yy = rc.top+6 ;
//画竖线
for (int i = 0 ; i < 15; i++ )
{
pdc->MoveTo(xx,yy);
pdc->LineTo(xx,y);
xx += step_x ;
}
xx = rc.left ;
yy = rc.top +6;
//画横线
for ( i = 0 ; i < 15 ; i++ )
{
pdc->MoveTo(xx,yy);
pdc->LineTo(x,yy);
yy += step_y ;
}// device context for painting
pdc->SelectObject(jbi);
UpdateData(FALSE);
CDC *pdc = m_mainboard.GetDC();
CRect rc ;
m_mainboard.GetClientRect(&rc);
CPen bi,*jbi;
bi.CreatePen(PS_DASH,2,RGB(248,162,247)); //创建黑色画笔
jbi=pdc->SelectObject(&bi);
int x = rc.right ;
int y = rc.bottom ;
int xx = rc.left ;
int yy = rc.top+6 ;
//画竖线
for (int i = 0 ; i < 15; i++ )
{
pdc->MoveTo(xx,yy);
pdc->LineTo(xx,y);
xx += step_x ;
}
xx = rc.left ;
yy = rc.top +6;
//画横线
for ( i = 0 ; i < 15 ; i++ )
{
pdc->MoveTo(xx,yy);
pdc->LineTo(x,yy);
yy += step_y ;
}// device context for painting
pdc->SelectObject(jbi);
UpdateData(FALSE);