首页 > 学院 > 开发设计 > 正文

透明位图测试

2019-11-11 05:31:18
字体:
来源:转载
供稿:网友
	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);
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表