jdl
jdl

Reputation: 6333

Capture Screen memory to a bitmap (visual c++ 6.0)

I am using visual c++ 6.0 and need to capture the image on the screen to memory. How do I do this? thx

Upvotes: 0

Views: 518

Answers (1)

Mark Ransom
Mark Ransom

Reputation: 308530

  • Get the DC for the screen with GetDC(NULL)
  • Create a memory DC with CreateCompatibleDC.
  • Create a bitmap compatible with the screen DC and the same size as the screen.
  • Select the bitmap into the memory DC.
  • BitBlt from the screen DC to the memory DC.
  • Deselect the bitmap from the memory DC.
  • Use GetBitmapBits to copy the bitmap into memory.

Upvotes: 4

Related Questions