I am trying to print out the color of a pixel (200,200). Ultimately I am trying to check the health of my player in a game based on the color of the pixel. However I have different resolutions on my laptop and desktop and I want the code to be able to find the right pixel.
This is what I have so far:
It doesn't get the same pixel on my laptop because of the resolution difference. What should I do?
This is what I have so far:
HDC hdcScreen = GetDC(0); COLORREF color = GetPixel(hdcScreen, 200, 200); ReleaseDC(NULL, hdcScreen); int iRed = GetRValue(color); int iBlue = GetBValue(color); int iGreen = GetGValue(color); cout << iRed << "\n"; cout << iBlue << "\n"; cout << iGreen << "\n";
It doesn't get the same pixel on my laptop because of the resolution difference. What should I do?