How can I read the bitmap's pixel values with Win32 API?

thebluetropics 1,046 Reputation points
2022-09-06T03:47:26.787+00:00

I have a bitmap of the entire screen. I want to read all pixel values (rgb) of the bitmap.

Here is my code:

   BITMAP bmp = GetScreenBitmap(); // somehow I got the bitmap  

there is BITMAP::bmBits but how can I use it?

Windows development | Windows API - Win32
Developer technologies | C++
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,686 Reputation points
    2022-09-06T05:56:11.373+00:00

    With GetDIBits or CreateDIBSection
    For example, I had posted a sample with CreateDIBSection in this thread : Scanning of screen pixels works in debug mode but not in release mode

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.