vc兼容dc问题
刚用兼容dc绘制透明位图,遇到下面奇怪的问题:直接用类对象没问题,用指针就不行,期待指教!C**View::OnDraw(CDC*pDC){......CBitmapbi...
刚用兼容dc绘制透明位图,遇到下面奇怪的问题:
直接用类对象没问题,用指针就不行,期待指教!
C**View::OnDraw(CDC* pDC)
{
......
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
CDC dc;
dc.CreateCompatiableDC(pDC);
dc.SelectObject(bitmap);
pDC->BitBlt(0,0,cx,cy,&dc,0,0,SRCOPY);
dc.DelectDC();
//上面功能正常,改成指针方式就不行了,郁闷
CDC *pMemDC;
pMemDC->CreateCompatibleDC(pDC);
pMemDC->SelectObject(bitmap);
pDC->BitBlt(200,200,cx,cy,pMemDC,0,0,SRCOPY);
pMemDC->DelectDC();
} 展开
直接用类对象没问题,用指针就不行,期待指教!
C**View::OnDraw(CDC* pDC)
{
......
CBitmap bitmap;
bitmap.LoadBitmap(IDB_BITMAP1);
CDC dc;
dc.CreateCompatiableDC(pDC);
dc.SelectObject(bitmap);
pDC->BitBlt(0,0,cx,cy,&dc,0,0,SRCOPY);
dc.DelectDC();
//上面功能正常,改成指针方式就不行了,郁闷
CDC *pMemDC;
pMemDC->CreateCompatibleDC(pDC);
pMemDC->SelectObject(bitmap);
pDC->BitBlt(200,200,cx,cy,pMemDC,0,0,SRCOPY);
pMemDC->DelectDC();
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询