我的CBrush在for循环中什么都画不出来是什么原因?

问题描述如下:

这是单文档的工程,在View类添加的函数,大神们,我错在哪儿了啊,求指教,为神马我的工程里面调用执行了之后,一片空白RGB没有问题,都是正常的
void CDetectDefectView::PrePainting()
{
CClientDC dc(this);

CBrush ***pBrush=new CBrush **[height];
CBrush *pOldBrush;

PNT Axy,Bxy;
int i,j;
for (i=0;i<height;i++)
{
pBrush[i]=new CBrush *[width];
for (j=0;j<width;j++)
{
Axy.x=unit_length*i*1.0e-2;//delta_x基本上在0.2左右
Axy.y=unit_length*j*1.0e-2;//delta_y基本上在0.2左右
Bxy.x=unit_length*(i+1)*1.0e-2;
Bxy.y=unit_length*(j+1)*1.0e-2;

pBrush[i][j]=new CBrush(RGB(RGB_data[i][j],0,255-RGB_data[i][j]));
//?寶嬻夋嶞丆杊巭幷?撪梕


pOldBrush=dc.SelectObject(pBrush[i][j]);//??夋嶞

dc.Rectangle(Axy.x,Axy.y,Bxy.x,Bxy.y);
dc.SelectObject(pOldBrush);
DeleteObject(pOldBrush);

}
}

}

void CDetectDefectView::Proceed()
{
ReadinCsv();
ChangeToRGB();
PrePainting();
}
void CDetectDefectView::OnFileOpen()
{




Proceed();

}
这是一个从CSV文件读取数据然后画图的过程,所以直接在OnFileOpen调用了

posted @ 2013-05-20 19:32  月夜风2012  阅读(185)  评论(0编辑  收藏  举报
合肥办公家具 数控模具