Commit cb42af21 by sn

Svg Klasse

1 parent 91fb10c7
Showing with 37 additions and 0 deletions
<?php
class mcSvg {
public static function getGraticuleAsDomElement(DOMElement $param_domelement, $param_x=0, $param_y=0, $param_lenght=10, $param_disableCircleIfSmallAs=false) {
$group = new DOMElement('g');
$group = $param_domelement->appendChild($group);
if($param_disableCircleIfSmallAs && $param_lenght >= $param_disableCircleIfSmallAs) {
// <circle cx ="40" cy ="40" r ="20" />
$circle = $group->appendChild(new DOMElement('circle'));
$circle->setAttribute('cx', $param_x);
$circle->setAttribute('cy', $param_y);
$circle->setAttribute('r', $param_lenght/3);
$circle->setAttribute('style', 'fill:#FFFFFF; stroke:black; stroke-width:.01cm;');
}
// <line x1="5" y1="5" x2="200" y2="100" style="stroke:black;stroke-width:3;" />
$line_vertikal = $group->appendChild(new DOMElement('line'));
$line_vertikal->setAttribute('x1', $param_x);
$line_vertikal->setAttribute('y1', $param_y - ($param_lenght/2));
$line_vertikal->setAttribute('x2', $param_x);
$line_vertikal->setAttribute('y2', $param_y + ($param_lenght/2));
$line_vertikal->setAttribute('style', 'stroke:black; stroke-width:.01cm;');
$line_horizontal = $group->appendChild(new DOMElement('line'));
$line_horizontal->setAttribute('x1', $param_x - ($param_lenght/2));
$line_horizontal->setAttribute('y1', $param_y);
$line_horizontal->setAttribute('x2', $param_x + ($param_lenght/2));
$line_horizontal->setAttribute('y2', $param_y);
$line_horizontal->setAttribute('style', 'stroke:black; stroke-width:.01cm;');
return $group;
}
}
?>
......@@ -25,6 +25,7 @@
require_once $__PATH_to_mcClasses . 'class_mcMail.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcConfig.inc.php';
require_once $__PATH_to_mcClasses . 'file/class_mcFile.inc.php';
require_once $__PATH_to_mcClasses . 'file/class_mcSvg.inc.php';
require_once $__PATH_to_mcClasses . 'file/class_mcInkscape.inc.php';
require_once $__PATH_to_mcClasses . 'file/class_mcCairoSvg.inc.php';
require_once $__PATH_to_mcClasses . 'file/class_mcImage.inc.php';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!