CreateCompatibleBitmap创建的兼容位图的透明背影色
CreateCompatibleBitmap是创建与hdc相关的兼容位图,它的背影色怎样才能是透明的?
HDC hdc = ::GetDC(this->m_hWnd);
HBITMAP hBitmap3 = CreateCompatibleBitmap(hdc, 800, 480);
HBITMAP hOldMemBmp3 = (HBITMAP)SelectObject(hdcMem3, hBitmap3);
我用了调色板设置为红色的,也不起作用
LPLOGPALETTE pLogPal;
pLogPal = (LOGPALETTE *)malloc(sizeof(LOGPALETTE)+(256*sizeof(PALETTEENTRY)));
pLogPal-> palVersion = 0x300;
pLogPal-> palNumEntries = 256;
int i;
for(i=0;i <256;i++)
{
pLogPal-> palPalEntry[i].peRed = 255;
pLogPal-> palPalEntry[i].peGreen = 0;
pLogPal-> palPalEntry[i].peBlue = 0;
pLogPal-> palPalEntry[i].peFlags = 0;
}
HPALETTE phPalette = CreatePalette(pLogPal);
//free(pLogPal);
SelectPalette(hdc,phPalette,FALSE);
RealizePalette(hdc);
[解决办法]
背景色透明和这个函数无关
[解决办法]