title: win32 - How do I capture a screen as an 8-bit or 16-bit bitmap?
body: <p>I am just starting out with win32 GDI programming and finding good references hard to come by. I have a simple application that captures the screen by doing the following:</p>
  
  <p><code></p>
  
  <pre><code>UINT32 x,y;
  x = GetSystemMetrics(SM_CXSCREEN);
  y = GetSystemMetrics(SM_CYSCREEN);
  
  HDC hdc = GetDC(NULL);
  HDC hdcScreen = CreateCompatibleDC(hdc);
  
  HBITMAP hbmp = CreateCompatibleBitmap(hdc, x, y);
  
  SelectObject(hdcScreen, hbmp);
  
  BitBlt(hdcScreen, 0, 0, x, y, hdc, 0, 0, SRCCOPY)
  
  ReleaseDC(NULL, hdc);
  </code></pre>
  
  <p></code></p>
  
  <p>I am capturing a compatible bitmap which on my machine is 32-bit. Using same/similar calls how would I capture the screen in 8-bit? What about as 16-bit?</p>