Is it possible insert image to a code comment?
There is an example here that extend the Visual Studio 2010 editor: Image Insertion (but it's tied to Visual Studio, not a generic solution)
For Python you can use Google Colab. Inside a text-block you can write something like:
![Alt text](https://someurl.com/image.png).
Example:
For C# you can try this plug-in:
https://marketplace.visualstudio.com/items?itemName=MsBishop.ImageComments
Literate Programming tools work this way; you basically use TeX or something to write the code, then run a preprocessor which extracts the code snippets into an intermediate source file. http://en.wikipedia.org/wiki/Literate_programming