/
sample.php
28 lines (25 loc) · 917 Bytes
/
sample.php
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
<?php
// sample
@include_once("class.logo.php");
@include_once("class.logo.parser.php");
// Header
header("Content-Type: image/png");
$im = @imagecreatetruecolor(720,600);
$canvas=new Logo(&$im, 255, 255, 255);
$canvas->setWrap(LOGO_WINDOW);
$textcolor = ImageColorAllocate($im, 0 ,0, 0);
$canvas->setPC($textcolor);
$canvas->pd();
// Draw a star
$src="repeat 5 [fd 100 rt 144]";
$errmsg="https://SteakOverCooked.com";
$parser=new LogoParser(&$canvas);
$ret=$parser->parse(($src));
$w=$parser->printWarnings();
$fs=$canvas->getFont();
imagestring($im, $fs, 0, $w, $parser->getMsg($ret), $canvas->getPC());
imagestring($im, $fs, 0, $w+imagefontheight($fs), $parser->getMemAndTime(), $canvas->getPC());
imagestring($im, 4, 0, imagesy($im)-imagefontheight(4), "(C) 2007~ ZHIHUA, LAI", $textcolor);
imagepng($im);
imagedestroy($im);
?>