0

I am unable to Create a Monochrome Mask for a 24BPP Colour image with SetBkColor() > BitBlt[SRCCOPY]. The Mask ends up completely Black. The entire thing works only if I use LoadImage() instead to get the HBITMAP.

Bitmap img(L"Ball.bmp");
HBITMAP hBM;
img.GetHBITMAP(Color::White, &hBM);
//hBM = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_BALL));
.
.
SelectObject(hDCSrc, hBM);
SetBkColor(RGB(0xFF, 0xFF, oxFF));
BitBlt(hDCMem, 0, 0, img.GetWidth(), img.GetHeight(), hDCSrc, 0, 0, SRCCOPY);

//hDCMem is copletely black; but OK when using LoadImage() instead

Other people with the same problem have suggested using Graphics::GetHDC and doing the required with this DC as a workaround. But why does it not work as it should.

Even this workaround din' work. Please help :(

Ujjwal Singh
  • 4,908
  • 4
  • 37
  • 54

1 Answers1

0

Solved it: How to genrate a monochrome bit mask for a 32bit bitmap

Community
  • 1
  • 1
Ujjwal Singh
  • 4,908
  • 4
  • 37
  • 54