看了b站上人家大佬玩祖玛,几秒钟一关,好吧你们开人形自走挂。那就别怪我开挂了。
我需要快速扫描整个屏幕,所以采用截图再分析的方式感觉会比较慢。
下面的代码为使用windowsAPI获取屏幕上一个像素点的 代码。
此处记录以备使用

// debug专用c++.cpp: 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include<iostream>
#include<string>
#include<Windows.h>
#include<iostream>
#include<algorithm>

using namespace std;

int getbit(int n, int i)
{
	return (n >> i)&1;
}

void output(int n)
{
	for (int i = 31; i >=0; i--)
	{
		cout << getbit(n, i);
	}
	cout << endl;
}

int main()
{
	cout << "hello" << endl;
	HDC hDc;
	hDc = CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
	//COLORREF 为32bit 内容为 8bit unused 8bit Red 8bit Green 8bit Blue
	COLORREF b = GetPixel(hDc, 200, 200);
	cout << b << endl;
	COLORREF color = RGB(2, 255, 1);
	cout << color << endl;
	output(color);
	output(b);
	DeleteDC(hDc);
	return 0;
}