SetPixel和BitBlt

时间:2014-10-19 01:48:45

标签: c++ mfc blit bitblt

我在做错了什么?我想在设备上下文中画一条黑线,然后用C ++将它blit到我的MFC应用程序:

void CmbmView::OnDraw(CDC* pDC)
{
  CRect WindowSize;
  GetClientRect(WindowSize);

  CDC *pMemDC = new CDC;

  pMemDC->SetPixel(0,0,RGB(0,0,0));
  pMemDC->SetPixel(1,1,RGB(0,0,0));
  pMemDC->SetPixel(2,2,RGB(0,0,0));
  pMemDC->SetPixel(3,3,RGB(0,0,0));
  pMemDC->SetPixel(4,4,RGB(0,0,0));
  pMemDC->SetPixel(6,6,RGB(0,0,0));
  pMemDC->SetPixel(7,7,RGB(0,0,0));
  pMemDC->SetPixel(8,8,RGB(0,0,0));
  pMemDC->SetPixel(9,9,RGB(0,0,0));

  pDC->BitBlt(0,0,WindowSize.Width(),WindowSize.Height(),pMemDC,0,0,SRCCOPY);

  delete pMemDC;
}

0 个答案:

没有答案