Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Documentation 如何在HTML Doxygen中指定图像大小?_Documentation_Doxygen_Image Resizing - Fatal编程技术网

Documentation 如何在HTML Doxygen中指定图像大小?

Documentation 如何在HTML Doxygen中指定图像大小?,documentation,doxygen,image-resizing,Documentation,Doxygen,Image Resizing,我试图在Doxygen生成的HTML中手动指定图像大小。然而,正如我在文章中所读到的,只有在使用LaTeX输出时才会发生这种情况。这里有人知道解决办法吗 举个例子,我想这样做: \image html example.png "Caption" width=10px 谢谢大家! 将其放在CSS文件“Doc/doxygen\u html\u style.CSS”中: 并将Doxygen配置变量*HTML\u EXTRA\u STYLESHEET*设置为“Doc/Doxygen\u HTML\u

我试图在Doxygen生成的HTML中手动指定图像大小。然而,正如我在文章中所读到的,只有在使用LaTeX输出时才会发生这种情况。这里有人知道解决办法吗

举个例子,我想这样做:

\image html example.png "Caption" width=10px
谢谢大家!

将其放在CSS文件“Doc/doxygen\u html\u style.CSS”中:


并将Doxygen配置变量*HTML\u EXTRA\u STYLESHEET*设置为“Doc/Doxygen\u HTML\u style.css”

为了避免使用额外的css样式表,您可以直接内联css代码:

\htmlonly <style>div.image img[src="test.png"]{width:100px;}</style> \endhtmlonly 
@image html test.png "Caption"

显然,随着时间的推移,有些事情发生了变化,因为在Doxygen 1.8.17中,它的工作方式几乎与原始问题中描述的方式相同(不涉及CSS):


编辑:刚刚在Doxygen 1.8.13中试用过,效果也很好:

\image html some.png width=50%

在这个答案的基础上,可以创建一个别名来设置样式并添加图像:alias=imageSize{3}=“\htmlonly div.image img[src=\“\1\”]{\2}\endhtmlonly\image html\1\“\3\”确保在
Doxyconf
文件中定义别名,以避免
Found unknown command\imageSize
确保编辑HTML\u EXTRA\u样式表而不是HTML\u样式表,我做了后者,这破坏了整个文档的样式。
ALIASES = imageSize{2}="\htmlonly <style>div.image img[src=\"\1\"]{\2}</style>\endhtmlonly"
@imageSize{test.png,height:270px;width:20px;}
@image html test.png "Caption"
\image html some.png width=800px
\image html some.png width=50%