<?php include "include.php"; $id = $_GET["id"]; $query = "SELECT titles.id,titles.name,titles.data,templates.w,templates.h,templates.path,templates.type FROM titles JOIN templates ON titles.template = templates.id WHERE titles.id={$id}"; $result = dbquery($query); $row = mysql_fetch_assoc($result); if ($row["type"] == "text") { $commands = getLinesFromText($row["path"]); } else { $commands = array(); } ?> <style type="text/css"> .floater { position:absolute; background-color: white; opacity:.8; margin:0px; border-style: solid; border-color:#00FF00; border-width: 1px; } .body { margin:0px; padding:0px; } .input {
include "include.php"; $id = $_GET["id"]; $query = "SELECT titles.id,titles.name,titles.data,templates.w,templates.h,templates.path,templates.type FROM titles JOIN templates ON titles.template = templates.id WHERE titles.id={$id}"; $result = dbquery($query); $title_row = mysql_fetch_assoc($result); $im = imagecreatetruecolor($title_row["w"], $title_row["h"]); imageantialias($im, true); imagealphablending($im, false); $alpha = imagecolorallocatealpha($im, 255, 255, 255, 127); imagefilledrectangle($im, 0, 0, $title_row["w"], $title_row["h"], $alpha); imagealphablending($im, true); $white = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 0, 0, 0); if ($title_row["type"] == "text") { $commands = getLinesFromText($title_row["path"]); } else { $commands = array(); } foreach ($commands as $c) { if ($c["command"] == "poly") { $color = getColor($id, $c["color"], $im); imagefilledpolygon($im, $c["points"], count($c["points"]) / 2, $color); } elseif ($c["command"] == "asset") { $asset = imagecreatefrompng($c["asset"]); imagecopy($im, $asset, $c["points"][0], $c["points"][1], 0, 0, $c["points"][2], $c["points"][3]); } elseif ($c["command"] == "img") { $imgsrc = getContent($id, $c["asset"]); $img = imagecreatefrompng("{$imgsrc}"); $size = getimagesize("{$imgsrc}"); imagecopyresampled($im, $img, $c["points"][0], $c["points"][1], 0, 0, $c["points"][2], $c["points"][3], $size[0], $size[1]);