setline($linesize, $r, $g, $b); $a = $radius * 0.414213562; //tan(22.5deg) $b = $radius * 0.707106781; //sqrt(2)/2 = sin(45deg) $circle->movePenTo($xstart+$radius, $ystart); $circle->drawCurveTo($xstart+$radius, $ystart-$a, $xstart+$b, $ystart-$b); $circle->drawCurveTo($xstart+$a, $ystart-$radius, $xstart, $ystart-$radius); $circle->drawCurveTo($xstart-$a, $ystart-$radius, $xstart-$b, $ystart-$b); $circle->drawCurveTo($xstart-$radius, $ystart-$a, $xstart-$radius, $ystart); $circle->drawCurveTo($xstart-$radius, $ystart+$a, $xstart-$b, $ystart+$b); $circle->drawCurveTo($xstart-$a, $ystart+$radius, $xstart, $ystart+$radius); $circle->drawCurveTo($xstart+$a, $ystart+$radius, $xstart+$b, $ystart+$b); $circle->drawCurveTo($xstart+$radius, $ystart+$a, $xstart+$radius, $ystart); return $circle; } function drawFilledCircle($radius, $xstart, $ystart, $linesize,$sr, $sg, $sb, $r, $g, $b){ $circle = new SWFShape(); $circle->setline($linesize, $sr, $sg, $sb); $circle->setrightfill($r, $g, $b); $a = $radius * 0.414213562; //tan(22.5deg) $b = $radius * 0.707106781; //sqrt(2)/2 = sin(45deg) $circle->movePenTo($xstart+$radius, $ystart); $circle->drawCurveTo($xstart+$radius, $ystart-$a, $xstart+$b, $ystart-$b); $circle->drawCurveTo($xstart+$a, $ystart-$radius, $xstart, $ystart-$radius); $circle->drawCurveTo($xstart-$a, $ystart-$radius, $xstart-$b, $ystart-$b); $circle->drawCurveTo($xstart-$radius, $ystart-$a, $xstart-$radius, $ystart); $circle->drawCurveTo($xstart-$radius, $ystart+$a, $xstart-$b, $ystart+$b); $circle->drawCurveTo($xstart-$a, $ystart+$radius, $xstart, $ystart+$radius); $circle->drawCurveTo($xstart+$a, $ystart+$radius, $xstart+$b, $ystart+$b); $circle->drawCurveTo($xstart+$radius, $ystart+$a, $xstart+$radius, $ystart); return $circle; } //example //$circle = drawCircle($rad+($i*2), 100, 100-($rad+$i*2), .5, 255, 255, 255); function drawFilledCircleAlpha($radius, $xstart, $ystart, $linesize, $r, $g, $b, $alpha){ $circle = new SWFShape(); $circle->setline($linesize, $r, $g, $b, $alpha); $circle->setrightfill($r, $g, $b, $alpha); $a = $radius * 0.414213562; //tan(22.5deg) $b = $radius * 0.707106781; //sqrt(2)/2 = sin(45deg) $circle->movePenTo($xstart+$radius, $ystart); $circle->drawCurveTo($xstart+$radius, $ystart-$a, $xstart+$b, $ystart-$b); $circle->drawCurveTo($xstart+$a, $ystart-$radius, $xstart, $ystart-$radius); $circle->drawCurveTo($xstart-$a, $ystart-$radius, $xstart-$b, $ystart-$b); $circle->drawCurveTo($xstart-$radius, $ystart-$a, $xstart-$radius, $ystart); $circle->drawCurveTo($xstart-$radius, $ystart+$a, $xstart-$b, $ystart+$b); $circle->drawCurveTo($xstart-$a, $ystart+$radius, $xstart, $ystart+$radius); $circle->drawCurveTo($xstart+$a, $ystart+$radius, $xstart+$b, $ystart+$b); $circle->drawCurveTo($xstart+$radius, $ystart+$a, $xstart+$radius, $ystart); return $circle; } ////////////////////////////////////////////////////////////////////////////////// // SQUARES ////////////////////////////////////////////////////////////////////////////////// function drawSquare($x0, $y0, $x1, $y1, $linesize, $r, $g, $b, $a=200) { $square = new SWFShape(); $square->setLine($linesize, $r, $g, $b, $a); $square->movePenTo($x0, $y0); $square->drawLineTo($x1, $y0); $square->drawLineTo($x1, $y1); $square->drawLineTo($x0, $y1); $square->drawLineTo($x0, $y0); return $square; } function drawFilledSquare($x0, $y0, $x1, $y1, $linesize, $r, $g, $b) { $square = new SWFShape(); $square->setLine($linesize, $r, $g, $b); $square->setRightFill($r, $g, $b); $square->movePenTo($x0, $y0); $square->drawLineTo($x1, $y0); $square->drawLineTo($x1, $y1); $square->drawLineTo($x0, $y1); $square->drawLineTo($x0, $y0); return $square; } function drawFilledSquareAlpha($x0, $y0, $x1, $y1, $linesize, $r, $g, $b, $a) { $square = new SWFShape(); $square->setLine($linesize, $r, $g, $b, $a); $square->setRightFill($r, $g, $b, $a); $square->movePenTo($x0, $y0); $square->drawLineTo($x1, $y0); $square->drawLineTo($x1, $y1); $square->drawLineTo($x0, $y1); $square->drawLineTo($x0, $y0); return $square; } function drawFilledSquareStroked($x0, $y0, $x1, $y1, $linesize, $r, $g, $b, $sr, $sg, $sb) { $square = new SWFShape(); $square->setLine($linesize, $sr, $sg, $sb); $square->setRightFill($r, $g, $b); $square->movePenTo($x0, $y0); $square->drawLineTo($x1, $y0); $square->drawLineTo($x1, $y1); $square->drawLineTo($x0, $y1); $square->drawLineTo($x0, $y0); return $square; } ////////////////////////////////////////////////////////////////////////////////// // LINES ////////////////////////////////////////////////////////////////////////////////// function drawLiner($x0, $y0, $x1, $y1, $linesize, $r, $g, $b){ $liner = new SWFShape(); $liner->setLine($linesize, $r, $g, $b); $liner->movePenTo($x0, $y0); $liner->drawLineTo($x1, $y1); return $liner; } function drawTriangle($x0, $y0, $w, $h, $linesize, $r, $g, $b, $sr, $sg, $sb){ $tri = new SWFShape(); $tri->setLine($linesize, $sr, $sg, $sb); $tri->setRightFill($r, $g, $b); $tri->movePenTo($x0, $y0); $tri->drawLineTo($w, $y0); $tri->drawLineTo($w, $h); $tri->drawLineTo($x0, $y0); return $tri; } ?>