File: svg.php

package info (click to toggle)
php-horde-image 2.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 3,012 kB
  • sloc: php: 8,580; xml: 1,207; sh: 4; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
 * @package Image
 */

require_once __DIR__ . '/../lib/Application.php';
Horde_Registry::appInit(
    'horde',
    array('authentication' => 'none', 'session_control' => 'none')
);

$image = new Horde_Image_Svg(
    array('height' => 400, 'width' => 400),
    array('tmpdir' => Horde::getTempdir())
);

$image->rectangle(30, 30, 100, 60, 'black', 'yellow');
$image->roundedRectangle(30, 30, 100, 60, 15, 'black', 'red');
$image->circle(30, 30, 30, 'black', 'blue');
$image->polygon(array(array('x' => 30, 'y' => 50), array('x' => 40, 'y' => 60), array('x' => 50, 'y' => 40)), 'green', 'green');
$image->arc(100, 100, 100, 0, 70, 'black', 'green');
$image->brush(100, 300, 'red', 'circle');

$image->line(0, 200, 500, 200, 'darkblue', 2);
$image->line(200, 200, 200, 500, 'darkblue', 2);

$image->polyline(array(array('x' => 130, 'y' => 150), array('x' => 140, 'y' => 160), array('x' => 150, 'y' => 140)), 'black', 5);

$image->text('Hello World', 100, 100, 'arial', 'purple');

$image->display();