Example #1
0
function test_asimage()
{
    $wplan = new WPlan(getTestInput());
    WPlan_ImageRenderer::asImage($wplan, TRUE, "wplan.png");
}
Example #2
0
 private static function drawBox($img, $x0, $y0, $dx, $dy, $color, WPlan_Event $event, $textColor)
 {
     $color = wplan_alpha($color, 48);
     imagefilledrectangle($img, $x0, $y0, $x0 + $dx, $y0 + $dy, $color);
     $dk = wplan_darken($color);
     $lt = wplan_lighten($color);
     imagerectangle($img, $x0, $y0, $x0 + $dx - 1, $y0 + $dy - 1, $lt);
     imagerectangle($img, $x0 + 1, $y0 + 1, $x0 + $dx, $y0 + $dy, $dk);
     WPlan_ImageRenderer::center($img, $event->name, $x0 + 2, $dx - 4, $y0 + 7, 8, $textColor, 1);
     $ss = "";
     if (isset($event->sensei)) {
         foreach ($event->sensei as $s) {
             $ss .= "/" . $s . "  ";
         }
     }
     WPlan_ImageRenderer::center($img, $ss, $x0, $dx, $y0 + 20, 8, $textColor);
     $txt = $event->info;
     if ($txt != NULL) {
         $i = 0;
         foreach ($txt as $rw) {
             WPlan_ImageRenderer::center($img, $rw, $x0, $dx, $y0 + 40 + $i * 10, 7, $textColor);
             $i++;
         }
     }
 }