Changeset 308
- Timestamp:
- 02/25/08 15:19:30 (6 months ago)
- Files:
-
- cleversvg/cleversvg/quick_examples.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cleversvg/cleversvg/quick_examples.php
r307 r308 1 1 <?php 2 //First, require the library call script 2 3 require_once('cleversvg.php'); 3 header("Content-type: image/svg+xml");4 4 5 //Instanciate a SVG document, specifying its width and height 5 6 $doc = new csDocument(550, 300, 'Un document SVG de test'); 6 7 8 //Then, you can define as many shapes objects as you want and add them to the document 7 9 $rect = new csRect(60, 60, 40, 40); 8 10 $rect->setFill('red'); 9 11 $rect->setStroke('yellow'); 10 12 $rect->setStrokeWidth('4'); 13 11 14 $doc->addElement($rect); 12 15 16 //Never forget to send image/svg+xml headers before outputing 17 header("Content-type: image/svg+xml"); 18 19 //When you're done, render the document as a standalone one 13 20 echo $doc->toXML(); 21 22 //Or an embedded one : 23 //echo $doc->toXML(true); 14 24 ?>
