将图像添加到源代码中 [英] Adding images into source code

查看:136
本文介绍了将图像添加到源代码中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法(或编辑器)允许我从源文件(例如* .java)中链接图像/文件/ http链接,类似富文本文档?

Is there a way (or an editor) that allows me to link an image/files/http links from within a source file (*.java for instance), sort of like a rich text document?

这样,在阅读代码时,我可以快速查看附加的图像(增加注释),而不是打开浏览器等。

This way, while reading the code I can quickly look at the appended image (augmenting the comments), instead of opening the browser etc.

推荐答案

Javadoc是HTML,所以你只需要嵌入图片:

Javadocs are HTML, so you can just embed images there:

/**
 * This class does some funky stuff (see diagram).
 * <img src="relative/path/to/your/image.png" />
 * 
 */
 public class FunkyClass{
 }

Eclipse会乐于在javadoc视图中显示图片,或者将鼠标悬停在注释上。其他IDE可能也可能不会这样做。

Eclipse will happily show you the images in the javadoc view or on hovering over the comment. Other IDEs might or might not do the same.

显然,你必须确保图像被部署的javadocs ...

Obviously you have to make sure somehow that the images are deployed with the javadocs...

这篇关于将图像添加到源代码中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆