Hi, folks.
The attached patch (vs. rrdtool-1.0.28) provides an additional option to
rrdgraph(1) which outputs the size and coordinates of the graph portion of
the image. This can be used to create image maps or automatically extract
the graph from the image file.
Here is the description from the rrdgraph.pod file:
-m|--imgmap-info (default: false)
Print coordinates and dimensions of the actual graph
portion of the image, appended to the image width and
height output. This information can be used to create
an HTML image map for CGI zoom applications, detail
views, etc.
The output line looks like :
<imgwidth>x<imgheight> (<gwidth>x<gheight>+<gleft>+<gbottom>)
For instance, rrdgraph --imgmap-info ... might print to
stdout:
495x155 (400x100+75+114)
This is a 495x155 image, with a 400x100 pixel graph
area. The lower left corner of the graph portion of the
image is at pixel coordinates (75,114).
The actual code changes are fairly minimal -- the caller passes an
additional 4 (int *)'s into rrd_graph. If '--imgmap-info' is set, they
are filled with the correct values from the image_data struct. Otherwise,
they are set to 0 (perhaps they should be left unmodified?).
Thanks again to Tobi (and all the other code contributors) for RRDtool!
- Karl "Rat" Schilke
--
O----O Terminator rAT -+- [EMAIL PROTECTED] -+- (360)816-3837 O----O
\Oo/ \oO/
==\/== "Peel fruit from cellophane backing before eating." ==\/==
-- Attached file removed by Listar and put at URL below --
-- Type: TEXT/PLAIN
-- Size: 7k (7835 bytes)
-- URL : http://www.ee.ethz.ch/~slist/pantomime/imgmap-info.patch
--
Unsubscribe mailto:[EMAIL PROTECTED]
Help mailto:[EMAIL PROTECTED]
Archive http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi