Filtering Bitmaps
Ok, so i know how to save a screen shot of my screen using a bit map. I don't know how to filter out the bits to find a certain RGB value I am looking for. I am planning to make a pixel aimbot. I just want to filter my bitmap for colors. Help appreciated and thanks in advance.
Code:
#include <iostream>
#include <windows.h>
using namespace std;
int main() {
// The pixel we're scanning for
COLORREF tofind = RGB( 255, 0, 0 );
// Screen size
int screen_width = GetSystemMetrics( SM_CXSCREEN );
int screen_height = GetSystemMetrics( SM_CYSCREEN );
// Get HBITMAP from our HDC of the screen
HDC hdc = GetDC( NULL );
HDC hdcMem = CreateCompatibleDC( hdc );
HBITMAP bmp = CreateCompatibleBitmap( hdcMem, screen_width, screen_height );
SelectObject( hdcMem, bmp );
BitBlt( hdcMem , 0, 0, screen_width, screen_height, hdc, 0, 0, SRCCOPY );
// bmp now contains the screenshot
}