|
现在内存中创建DC,draw到内存DC,然后bitblt到目标DC,不仅速度快,还可以实现很多效果。我的数码相框就是这样做的
HDC m_hdc = GetDc(NULL);
HDC hMenDc = CreateCompatibleDC(NULL);
HBITMAP hBmp = CreateCompatibleBitmap(hMenDc,800,600);
HGDIOBJ hOldBmp = SelectObject(hMenDc,hbmp);
RECT rc;
rc.left = 0;
rc.top = 0;
rc.bottom = 800;
rc.right = 600;
pImage->Draw(m_hdc,&rc,NULL);
BitBlt(m_hdc,rc.left,rc.top,800,600,hMenDc,0,0,SRCCOPY);
SAFERELEASE(pImage)
SelectObject(hMenDc,hOldBmp );
DeleteObject(hBmp );
DeleteDC(hMenDc);
以上是代码,至于效果,就不发了 |
|