public function testBorder() { $s = new Svg('graph.svg', '640px', '480px'); $s->setStrokeWidth(5, 6, 4); $s->border(5); $this->assertEquals(640, $s->getWidth()); }
<?php require_once '../../bootstrap.php'; use Pop\Color\Space\Rgb; use Pop\Image\Svg; try { $points = array(array('x' => 320, 'y' => 50), array('x' => 400, 'y' => 100), array('x' => 420, 'y' => 200), array('x' => 280, 'y' => 320), array('x' => 200, 'y' => 180)); $image = new Svg('new-image.svg', 640, 480, new Rgb(255, 0, 0)); $image->setFillColor(new Rgb(0, 0, 255))->setStrokeColor(new Rgb(255, 255, 255))->setStrokeWidth(3)->drawPolygon($points)->output(); } catch (\Exception $e) { echo $e->getMessage(); }