Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify image size in HTML Doxygen?

I am trying to manually specify the image size in the HTML generated by Doxygen. However, as I read in the documentation, this can only happen if using LaTeX output. Anybody here knows any workaround?

As an example, I would like to do something like this:

\image html example.png "Caption" width=10px

Thank you!

like image 602
Oriol Nieto Avatar asked Apr 12 '13 15:04

Oriol Nieto


3 Answers

Put this in the CSS file "Doc/doxygen_html_style.css":

div.image img[src="example.png"]{ 
    width:100px; 
}

And set the Doxygen config variable *HTML_EXTRA_STYLESHEET* to "Doc/doxygen_html_style.css"

like image 198
Per Avatar answered Nov 10 '22 19:11

Per


Apparently, something changed over the years, because in Doxygen 1.8.17 it works almost the way it is described in the original question (no CSS involved):

\image html some.png width=800px

Edit: just tried this with Doxygen 1.8.13 and it also works quite well:

\image html some.png width=50%
like image 15
retif Avatar answered Nov 10 '22 19:11

retif


To avoid resorting to an extra CSS style sheet you can directly inline the CSS code:

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

even better create an alias in Doxygen configuration file:

ALIASES = imageSize{2}="\htmlonly <style>div.image img[src=\"\1\"]{\2}</style>\endhtmlonly"

and then use this new and shorter Doxygen command:

@imageSize{test.png,height:270px;width:20px;}
@image html test.png "Caption"
like image 14
arkan Avatar answered Nov 10 '22 19:11

arkan