示例#1
0
if ($xml->geo->blackBox) {
    foreach ($xml->geo->blackBox as $box) {
        $l = dbFetch($id, $box);
        blackBox($canvas, $l["x"], $l["y"], $l["w"], $l["h"]);
    }
}
if ($xml->geo->slantRectangle) {
    foreach ($xml->geo->slantRectangle as $slantRectangle) {
        $sR = dbFetch($id, $slantRectangle);
        slantRectangle($canvas, $sR["x"], $sR["y"], $sR["w"], $sR["h"], $sR["color"]);
    }
}
if ($xml->overlay->shadowText) {
    foreach ($xml->overlay->shadowText as $text) {
        $t = dbFetch($id, $text);
        shadowedText($canvas, $t["x"], $t["y"], $t["w"], $t["h"], $t["text"], $t["gravity"], $t["font"], $t["color"]);
    }
}
if ($xml->overlay->plainText) {
    foreach ($xml->overlay->plainText as $text) {
        $t = dbFetch($id, $text);
        plainText($canvas, $t["x"], $t["y"], $t["w"], $t["h"], $t["text"], $t["gravity"], $t["font"], $t["color"], true);
    }
}
if ($xml->overlay->placeImage) {
    foreach ($xml->overlay->placeImage as $image) {
        $l = dbFetch($id, $image);
        //print_r($l);
        placeImage($canvas, $l["x"], $l["y"], $l["w"], $l["h"], $l["path"]);
    }
}
示例#2
0
文件: imagick.php 项目: hamilr2/rpits
<?php

include "imagick_include.php";
$canvas = new Imagick();
$canvas->newImage(700, 60, "none", "png");
//blackBox($canvas,48,130,862,200);
slantRectangle($canvas, 10, 10, 670, 40, '#d00000');
$fontN = "fonts/GothamNarrow-Bold.otf";
$west = imagick::GRAVITY_WEST;
shadowedText($canvas, 45, 15, 600, 30, "Your Imagick install is configured correctly!", "west", "fontN", "white");
header("Content-Type: image/png");
echo $canvas;
示例#3
0
}
placeImage($canvas, 1442, 802 - $boxHeightModifier, 76, 76, "teamlogos/" . $teamrow["logo"] . ".png");
shadowedText($canvas, 560 + $nameModifier, 805 - $boxHeightModifier, 535 - $nameModifier - $positionWidthModifier, 70, $row["first"] . " " . $row["last"], "west", "fontN", "white");
shadowedText($canvas, 1100 - $positionWidthModifier, 800 - $boxHeightModifier, 150, 80, $row["num"], "center", "fontN", "white");
shadowedText($canvas, 1210 - $positionWidthModifier, 800 - $boxHeightModifier, 130 + $positionWidthModifier, 80, $row["pos"], "center", "fontN", "white");
shadowedText($canvas, 1300, 800 - $boxHeightModifier, 140, 80, $row["year"], "center", "fontN", "white");
$details = "Hometown: " . $row["hometown"] . "       Ht: " . $row["height"] . "       Wt: " . $row["weight"];
$detailsGravity = "west";
if (!$size[0]) {
    $details = "Hometown: " . $row["hometown"] . "       Height: " . $row["height"] . "       Weight: " . $row["weight"];
    $detailsGravity = "center";
}
plainText($canvas, 630 + $detailsModifier, 884 - $boxHeightModifier, 880 - $detailsModifier, 33, $details, $detailsGravity, "fontN", "white");
if ($stype && $stype != "txt") {
    if ($lastSeason == true) {
        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");
示例#4
0
include "include.php";
include "imagick_include.php";
$name = $_GET["name"];
$id = $_GET["id"];
$type = $_GET["type"];
$attr = dbFetchAll($id, $name, $type);
//print_r($attr);
$canvas = new Imagick();
$canvas->newImage($attr["w"] + 20, $attr["h"] + 30, "none", "png");
if ($type == "slantRectangle") {
    slantRectangle($canvas, 10, 10, $attr["w"], $attr["h"], $attr["color"]);
} else {
    if ($type == "blackBox") {
        blackBox($canvas, 10, 10, $attr["w"], $attr["h"]);
    } else {
        if ($type == "plainText") {
            plainText($canvas, 10, 10, $attr["w"], $attr["h"], $attr["text"], $attr["gravity"], $attr["font"], $attr["color"]);
        } else {
            if ($type == "shadowText") {
                shadowedText($canvas, 10, 10, $attr["w"], $attr["h"], $attr["text"], $attr["gravity"], $attr["font"], $attr["color"]);
            } else {
                if ($type == "placeImage") {
                    placeImage($canvas, 10, 10, $attr["w"], $attr["h"], $attr["path"]);
                }
            }
        }
    }
}
header("Content-Type: image/png");
echo $canvas;