shadowedText($canvas, 410, 995, 172, 30, 'Last Season:', 'center', 'fontN', 'white');
    }
    $i = 2;
    for (; strlen($slabel[$i]) > 0; $i++) {
    }
    $boxW = 880 / ($i - 2);
    $totalwidths = 0;
    for ($j = 2; $j < $i; $j++) {
        $totalwidths += getTextWidth($boxW, 80, $row[$j + 8], "fontN");
    }
    //echo $totalwidths;
    $spacing = (880 - $totalwidths) / ($i - 2);
    //plainText($canvas,50,50,300,50,$i-2 . ", $boxW, $totalwidths, $spacing ","left","fontN","white");
    $xpos = 650;
    for ($j = 2; $j < $i; $j++) {
        $thisWidth = getTextWidth($boxW, 80, $row[$j + 8], "fontN");
        $xpos -= ($boxW - $thisWidth) / 2;
        plainText($canvas, $xpos, 915, $boxW, 40, $slabel[$j], "center", "fontN", "white");
        plainText($canvas, $xpos, 955, $boxW, 80, $row[$j + 8], "center", "fontN", "white");
        $xpos += ($boxW - $thisWidth) / 2 + $thisWidth + $spacing;
    }
}
dbquery("REPLACE INTO cache SET `key` = '{$key}', `hash` = '{$hash}';");
$filename = $row["num"] . $row["first"] . $row["last"];
$canvas->setImageDepth(8);
$canvas->writeImage('out/' . $filename . '.png');
$thumb = $canvas->clone();
$thumb->cropImage(318, 239, 398, 794);
$thumb->resizeImage(53, 40, Imagick::FILTER_TRIANGLE, 1);
$thumb->writeImage('thumbs/' . $filename . '.png');
header("Content-Type: image/png");
Exemple #2
0
        $statsBoxX = 135;
        $statsBoxWidth = 950;
    }
    $i = 2;
    for (; strlen($slabel[$i]) > 0; $i++) {
    }
    $boxW = $statsBoxWidth / ($i - 2);
    $totalwidths = 0;
    for ($j = 2; $j < $i; $j++) {
        $totalwidths += getTextWidth(array('w' => $boxW, 'h' => 80, 'text' => $row[$j + 8], 'font' => "fontN"));
    }
    //echo $totalwidths;
    $spacing = ($statsBoxWidth - $totalwidths) / ($i - 2);
    //plainText($canvas,50,50,300,50,$i-2 . ", $boxW, $totalwidths, $spacing ","left","fontN","white");
    for ($j = 2; $j < $i; $j++) {
        $thisWidth = getTextWidth(array('w' => $boxW, 'h' => 80, 'text' => $row[$j + 8], 'font' => "fontN"));
        $statsBoxX -= ($boxW - $thisWidth) / 2;
        plainText($blackBox, array('x' => $statsBoxX, 'y' => 55, 'w' => $boxW, 'h' => 40, 'text' => $slabel[$j], 'gravity' => "center", 'font' => "fontN", 'color' => "white"));
        plainText($blackBox, array('x' => $statsBoxX, 'y' => 95, 'w' => $boxW, 'h' => 80, 'text' => $row[$j + 8], 'gravity' => "center", 'font' => "fontN", 'color' => "white"));
        $statsBoxX += ($boxW - $thisWidth) / 2 + $thisWidth + $spacing;
    }
}
/*$filename = $row["num"] . $row["first"] . $row["last"];

$mainBar->setImageDepth(8);
$mainBar->writeImage(realpath('anim') . '/' . $filename . '_bar.png');

$blackBox->setImageDepth(8);
$blackBox->writeImage(realpath('anim') . '/' . $filename . '_box.png');

$logoBox->setImageDepth(8);