Insert image in code (.cs) file

2019-08-02 09:28发布

Can we insert an image in CS (VS2008) file as an reference to support the complex logic?

The code is quite complex so I want to put the UML image of that code to increase the understanding.

Ram

4条回答
ら.Afraid
2楼-- · 2019-08-02 09:51

I guess you want to embed an image inside the code editor? In Visual Studio you can't do that (maybe there exists a 3rd party plugin which i'm not aware of).

All you can do is to embed some ascii art or add the image as separate file to your project and reference it in your comment.

查看更多
等我变得足够好
3楼-- · 2019-08-02 09:52

Yes you can embed image inside the code editor. But the only extension I know it is Image Insertion extension for Visual Studio 2010. You can get it from Visual Studio Gallery.

查看更多
相关推荐>>
4楼-- · 2019-08-02 09:53

You can use a hyperlink in a comment. Example:

// See reference image: http://ourserver.com/documentation/images/reference1.jpg

And it will turn into a working hyperlink that anyone can click while pressing the CTRL key

查看更多
forever°为你锁心
5楼-- · 2019-08-02 09:58

You can but for that you will need to create a static byte array and manually fill the array from the bytes of the image file like: static byte[] img = new byte[]{/*all image file bytes*}

I would suggest you to add the image as a resource to the assembly and then you can read it at runtime and do the required processing.

查看更多
登录 后发表回答