[求助]数字图像问题
void CWallDlg::show(int x,int y)
{//x,y,分别为输出的X和Y座标,利用StretchBlt()来作图
if(!m_hBitmap)
return;
CBitmap m_bmp;
m_bmp.Attach(m_hBitmap);
BITMAP bm;
m_bmp.GetObject(sizeof(BITMAP),&bm);
CDC* pDC=GetDC();
CRect rc;
int nWidth,nHeight,nX=0,nY=0;
nWidth=bm.bmWidth;
nHeight=bm.bmHeight;
CDC dcMem;//创建内存设备环境
dcMem.CreateCompatibleDC(pDC);
CBitmap* pOldbmp=dcMem.SelectObject(&m_bmp);//选入内存设备环境
pDC->StretchBlt(x,y,30,30,&dcMem,0,0,nWidth,nHeight,SRCCOPY);
dcMem.SelectObject(pOldbmp);//恢复原来的内存设备环境
}
void CWallDlg::OnButton1()
{
// TODO: Add your control notification handler code here
int xx;
for(int i=0;i<10;i++)
{
xx=i*30;
show(xx,0);
}
}
为什么不能连续输出图的呀!!!
怎样改正?
{
// TODO: Add your control notification handler code here
int xx;
for(int i=0;i<10;i++)
{
xx=i*30;
show(xx,0);
}
}
为什么不能连续输出图的呀!!!
怎样改正?