Your question doesn’t make sense with the code you posted. You are requesting the pixel from an image (tmpImg), which is not related to the screen. If you were to somehow capture the contents of the screen into an image, you could use that image to examine the screen pixel. If you just want to get the info of what is in a JUCE Component you can use this API:
Image Component::createComponentSnapshot(Rectangle< int > areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f)
If you want to grab things outside of your application, then you will need to do something else, which is indicated at the end of this thread:
