As a result from the feature request Discourage screenshots of code and/or errors about 2.67 years ago, a message has been added to the image uploader warning users not to use them as a means to add code to the post, see this meta answer.
However, this feature is only active for users with 15 reputation and below, while users below 10 rep simply cannot post images at all.
I have no stats on the result of this measure, but from personal experience the practice of code screenshots is still highly prevalent.
Side note: The feature was temporarily broken and only reintroduced this February. To my knowledge the reputation limit remains the same, though.
I propose to either substantially raise or remove this reputation limit entirely, as the message is currently displayed for hardly anybody and its effect thereby massively stifled.
idownvotedbecau.se
link. The post got a flurry of downvotes and was put on hold (no MCVE) before the OP had a chance to respond.