HDC dc; HDC dcMem; HDC dcMask; HBITMAP bmp,bmpMask; dc=::GetDC(this->GetSafeHwnd()); dcMem = CreateCompatibleDC(dc); bmp = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE( IDB_BITMAP1)); SelectObject(dcMem,bmp); SetBkColor(dcMem,RGB(255,0,0)); dcMask = CreateCompatibleDC(dc); bmpMask = CreateBitmap(48,48,1,1,NULL); SelectObject(dcMask,bmpMask); BitBlt(dcMask,0,0,48,48,dcMem,0,0,SRCCOPY); BitBlt(dc,0,0,48,48,dcMem,0,0,SRCINVERT); BitBlt(dc,0,0,48,48,dcMask,0,0,SRCAND); BitBlt(dc,0,0,48,48,dcMem,0,0,SRCINVERT); ::ReleaseDC(this->GetSafeHwnd(),dc); DeleteDC(dcMem);
新闻热点
疑难解答