Home > Software engineering >  CBitmap: : CreateCompatibleBitmap established after a default is a monochrome stock bitmap, how to c
CBitmap: : CreateCompatibleBitmap established after a default is a monochrome stock bitmap, how to c

Time:09-29

Written in the MSDN CBitmap after performing CreateCompatibleBitmap, if the CDC as a memory device context, the default setting is monochromatic figure, how will it change into a color image Bitmap
The term address:
https://msdn.microsoft.com/en-us/library/6t1yfd35.aspx#CBitmap::CreateCompatibleBitmap

CodePudding user response:

HWND HWND=: : GetDesktopWindow ();//get the HWND of the screen.
HDC hScreenDC=: : GetDC (hWnd);//get the screen HDC.
HDC MemDC=: : CreateCompatibleDC (hScreenDC);

M_Hbitmap=: : CreateCompatibleBitmap (hScreenDC u32W, u32H);
Can't use memDC GetDC is to be used for the dc
  • Related