Source for file SVG.php
Documentation is available at SVG.php
// +------------------------------------------------------------------------+
// | PEAR :: Image :: GIS :: SVG Renderer |
// +------------------------------------------------------------------------+
// | Copyright (c) 2002-2005 Jan Kneschke <jan@kneschke.de> and |
// | Sebastian Bergmann <sb@sebastian-bergmann.de>. |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License, |
// | that is available at http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
// $Id: SVG.php 299207 2010-05-10 10:21:58Z clockwerx $
require_once 'Image/GIS/Renderer.php';
require_once 'XML/SVG.php';
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright Copyright © 2002-2005 Jan Kneschke <jan@kneschke.de> and Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0
$this->svg = new XML_SVG_Document (
* Draws a line from ($x1, $y1) to ($x2, $y2)
* using the color rgb($r, $g, $b).
function drawLine($x1, $y1, $x2, $y2, $r, $g, $b) {
$group = md5($r . $g . $b);
$this->svgGroups[$group] = new XML_SVG_Group (
'stroke:rgb(%s, %s, %s)',
$line = new XML_SVG_Line (
* Saves the rendered image to a given file.
* @param string $filename
if ($fp = @fopen($filename, 'w')) {
@fputs($fp, $this->svg->bufferObject ());
* Shows the rendered image.
$this->svg->printElement ();
Documentation generated on Mon, 11 Mar 2019 15:39:27 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|