Screenshots of code is discouraged, but it is still a recurring problem.
The question asking page is pretty clever though, and already prompts users to do the right thing. But nonetheless, screenshot posting is still an issue.
Could SO run a simple algorithm on an image to see if it contains code?
Following that show a prompt:
Your post appears to contain a screenshot of code. Please paste the code instead, in accordance with our code of conduct.