-
VC picture控件能够显示并移动透明图片,虽然透明效果已经实现,但却出现了重影问题
资源介绍
VC picture控件显示透明图片,并移动图片,透明可以了,但是有重影,为什么啊?
使用了这个函数http://www.newsmth.net/bbsanc.php?path=/groups/comp.faq/VisualC/VC_NEW_TXTFONTIMAGEDC/VC_NEW_DTFI_DRAWIMG/M.969736108.A
将图片刷到picture控件的DC上,可以透明了,但是,在移动的时候有重影
onpaint下代码
[code=C/C++] CDC *pDC = NULL;
HDC hDC = NULL;
HBITMAP m_hBitmap;
m_hBitmap = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_BITMAP1));
pDC = GetDC();
hDC = pDC->m_hDC;
pDC->Rectangle(10, 10, 100, 100);
pDC->SetBkMode(TRANSPARENT);
DrawTransparentBitmap(hDC, m_hBitmap, 0, 0, RGB(255,255,255));
pDC = GetDlgItem(IDC_PIC)->GetDC();
hDC = pDC->m_hDC;
DrawTransparentBitmap(hDC, m_hBitmap, 0, 0, RGB(255,255,255));
ReleaseDC(pDC);
pDC = NULL;[/code]
工程代码在这里: