帮忙看看这个程序!!立即给分
void CFloor::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{ CClientDC dc(this);
CRect rect;
GetClientRect(&rect);
float fxW = rect.Width()/float(RECT_NX);
float fyH = rect.Height()/float(RECT_NY);
for(int y=0; y<RECT_NY; y++)
{
rect = CRect(0,int(y*fyH),int(fxW),int(fyH*(y+1)));
for(int x=0; x<RECT_NX; x++)
{
dc.FillSolidRect(rect.left,rect.top,rect.Width()-1,rect.Height()-1,m_color);
rect.OffsetRect(int(fxW),0);
}
}
}
其中
#define RECT_NX =10
#define RECT_NY =10
rect = CRect(0,int(y*fyH),int(fxW),int(fyH*(y+1)));
dc.FillSolidRect(rect.left,rect.top,rect.Width()-1,rect.Height()-1,m_color);
这两句我不太理解请大虾请教!~~~!!立即给分