本文整理汇总了PHP中pChart::drawCubicCurve方法的典型用法代码示例。如果您正苦于以下问题:PHP pChart::drawCubicCurve方法的具体用法?PHP pChart::drawCubicCurve怎么用?PHP pChart::drawCubicCurve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pChart
的用法示例。
在下文中一共展示了pChart::drawCubicCurve方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: draw
/**
* Рисует график по переданным данным
*
* @param array $points
* @return string путь к файлу графика
*/
private function draw(array $points)
{
$errLevel = error_reporting();
error_reporting(0);
$newsList = $this->dataProvider->getNewsList();
$classLoader = new CPChart();
$DataSet = new pData();
foreach ($points as $news_id => $set) {
$DataSet->AddPoint($set, "news" . $news_id);
$DataSet->SetSerieName($newsList[$news_id], "news" . $news_id);
}
$DataSet->AddAllSeries();
$DataSet->AddPoint(array_values($this->dataProvider->getDates()), "dates");
$DataSet->SetAbsciseLabelSerie('dates');
// Initialise the graph
$chart = new pChart(700, 250);
$chart->setFontProperties($classLoader->Cpath("Fonts/tahoma.ttf"), 7);
$chart->setGraphArea(60, 30, 570, 200);
$chart->drawFilledRoundedRectangle(7, 7, 693, 253, 5, 240, 240, 240);
$chart->drawRoundedRectangle(5, 5, 695, 255, 5, 230, 230, 230);
$chart->drawGraphArea(255, 255, 255, true);
$data = $DataSet->GetData();
if (!empty($data)) {
$chart->drawScale($data, $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, true, 45, 2, true, 3);
$chart->drawGrid(4, true, 230, 230, 230, 50);
$chart->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
// Finish the graph
$chart->setFontProperties($classLoader->Cpath("Fonts/tahoma.ttf"), 8);
$chart->drawLegend(590, 20, $DataSet->GetDataDescription(), 255, 255, 255);
}
// Restore reporting level
error_reporting($errLevel);
return $this->render($chart, $points);
}
示例2: createGraphToFile
/**
* Генерация графика
* @param DataSet $DataSet
* @param String $GraphTitle
* @param String $safeToFile
*/
function createGraphToFile($DataSet, $GraphTitle, $safeToFile, $scaleFormat)
{
// Rotrate
$rotate = 30;
// Initialise the graph
$GraphImage = new pChart(594, 344);
$GraphImage->setDateFormat($scaleFormat);
// $GraphImage->loadColorPalette(DIR_FONT.'/tones-3.txt');
$GraphImage->setFontProperties(DIR_FONT . "/segoepr.ttf", 8);
$GraphImage->setGraphArea(80, 50, 580, 300);
$GraphImage->drawFilledRectangle(3, 3, 590, 340, 240, 240, 240);
$GraphImage->drawRectangle(0, 0, 593, 343, 230, 230, 230);
$GraphImage->drawGraphArea(255, 255, 255, TRUE);
$GraphImage->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_START0, 150, 150, 150, TRUE, $rotate, 0, FALSE);
$GraphImage->drawGrid(4, TRUE, 230, 230, 230, 50);
// Draw the 0 line
$GraphImage->setFontProperties(DIR_FONT . "/segoepr.ttf", 6);
$GraphImage->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
// Просто пунктирная линия
// Draw the cubic curve graph
$GraphImage->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
// Draw the line graph
//$GraphImage->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
$GraphImage->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
// Finish the graph
$GraphImage->setFontProperties(DIR_FONT . "/segoepr.ttf", 12);
$GraphImage->drawTitle(60, 32, $GraphTitle, 50, 50, 50, 600);
//$GraphImage->Render(DIR_CACHE . './' . $safeToFile . '.png');
$GraphImage->Stroke();
}
示例3: line
function line($valores, $titulo, $label = array())
{
$nombre = tempnam('/tmp', 'g') . '.png';
$DataSet = new pData();
$ind = 1;
$DataSet->AddPoint($valores, 'Serie' . $ind);
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName($titulo, 'Serie' . $ind);
if (count($label) > 0) {
$ID = 0;
foreach ($label as $val) {
$DataSet->Data[$ID]["Name"] = $val;
$ID++;
}
}
$Test = new pChart(300, 200);
$Test->setFontProperties(APPPATH . 'libraries/pChart/Fonts/tahoma.ttf', 8);
$Test->setGraphArea(70, 30, 280, 170);
$Test->drawFilledRoundedRectangle(7, 7, 293, 193, 5, 240, 240, 240);
$Test->drawRoundedRectangle(5, 5, 295, 195, 5, 230, 230, 230);
$Test->drawGraphArea(255, 255, 255, TRUE);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, true, 0, 0);
$Test->drawGrid(4, TRUE, 200, 200, 200, 50);
$Test->setFontProperties(APPPATH . 'libraries/pChart/Fonts/tahoma.ttf', 6);
$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->setFontProperties(APPPATH . 'libraries/pChart/Fonts/tahoma.ttf', 8);
$Test->drawLegend(200, 9, $DataSet->GetDataDescription(), 255, 255, 255);
$Test->setFontProperties(APPPATH . 'libraries/pChart/Fonts/tahoma.ttf', 10);
//$Test->drawTitle(10,22,$titulo,50,50,50,300);
$Test->Render($nombre);
return $nombre;
}
示例4: pCache
$DataSet->AddPoint(array(1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1");
$DataSet->AddPoint(array(1, 4, 2, 6, 2, 3, 0, 1, 5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 2), "Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbsciseLabelSerie();
$DataSet->SetSerieName("January", "Serie1");
$DataSet->SetSerieName("February", "Serie2");
// Cache definition
$Cache = new pCache();
$Cache->GetFromCache("Graph1", $DataSet->GetData());
// Initialise the graph
$Test = new pChart(700, 230);
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->setGraphArea(50, 30, 585, 200);
$Test->drawFilledRoundedRectangle(7, 7, 693, 223, 5, 240, 240, 240);
$Test->drawRoundedRectangle(5, 5, 695, 225, 5, 230, 230, 230);
$Test->drawGraphArea(255, 255, 255, TRUE);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), 5, 150, 150, 150, TRUE, 0, 2);
$Test->drawGrid(4, TRUE, 230, 230, 230, 50);
// Draw the 0 line
$Test->setFontProperties("Fonts/tahoma.ttf", 6);
$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
// Draw the cubic curve graph
$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
// Finish the graph
$Test->setFontProperties("Fonts/tahoma.ttf", 8);
$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255);
$Test->setFontProperties("Fonts/tahoma.ttf", 10);
$Test->drawTitle(50, 22, "Example 1", 50, 50, 50, 585);
// Render the graph
$Cache->WriteToCache("Graph1", $DataSet->GetData(), $Test);
$Test->Render("example1.png");
示例5: pCache
// Dataset
$DataSet->AddPoints(array(1, 4, 3, 2, 3, 3, 2, 1, 0, 7, 4, 3, 2, 3, 3, 5, 1, 0, 7), "Serie1");
$DataSet->AddPoints(array(1, 4, 2, 6, 2, 3, 0, 1, 5, 1, 2, 4, 5, 2, 1, 0, 6, 4, 2), "Serie2");
$DataSet->AddAllSeries();
$DataSet->SetAbscissaLabelSeries();
$DataSet->SetSeriesName("January", "Serie1");
$DataSet->SetSeriesName("February", "Serie2");
// Cache definition
$Cache = new pCache();
$Cache->GetFromCache("Example11", $DataSet->GetData());
// Initialise the graph
$Chart->setFontProperties("../Fonts/tahoma.ttf", 8);
$Chart->setGraphArea(50, 30, 585, 200);
$Chart->drawScale($DataSet, ScaleStyle::DefaultStyle(), 0, 2);
$Chart->drawGrid(new GridStyle(4, TRUE, new Color(230), 50));
// Draw the 0 line
$Chart->setFontProperties("../Fonts/tahoma.ttf", 6);
$Chart->drawTreshold(0, new Color(143, 55, 72), TRUE, TRUE);
// Draw the cubic curve graph
$Chart->drawCubicCurve($DataSet, 0.1, "Serie1");
$Chart->drawCubicCurve($DataSet, 0.1, "Serie2");
// Finish the graph
$Chart->setFontProperties("../Fonts/tahoma.ttf", 8);
$Chart->drawLegend(600, 30, $DataSet->GetDataDescription(), new Color(255));
$Chart->setFontProperties("../Fonts/tahoma.ttf", 10);
$Chart->drawTitle(50, 22, "Example 1", new Color(50), 585);
// Render the graph
$Cache->WriteToCache("Example11", $DataSet->GetData(), $Chart);
$Chart->Render("Example11.png");
header("Content-Type:image/png");
readfile("Example11.png");
示例6: componentLineGraph
public function componentLineGraph()
{
$DataSet = new pData();
$maxvals = array();
foreach ($this->datasets as $ds_id => $dataset) {
$DataSet->AddPoint($dataset['values'], "Serie" . $ds_id, array_keys($dataset['values']));
$maxvals[] = max($dataset['values']);
if (isset($dataset['burndown'])) {
$amount = count($dataset['values']) > 1 ? $dataset['burndown']['maxEstimation'] / (count($dataset['values']) - 1) : 0;
for ($i = 0; $i < count($dataset['values']); $i++) {
$burndownValues[] = $dataset['burndown']['maxEstimation'] - $i * $amount;
}
$DataSet->AddPoint($burndownValues, "Burndown" . $ds_id, $dataset['burndown']['maxEstimation']);
}
}
$DataSet->AddAllSeries();
if (isset($this->labels)) {
$DataSet->AddPoint($this->labels, "Labels");
$DataSet->SetAbsciseLabelSerie("Labels");
} else {
$DataSet->SetAbsciseLabelSerie();
}
foreach ($this->datasets as $ds_id => $dataset) {
$DataSet->SetSerieName($dataset['label'], "Serie" . $ds_id);
if (isset($dataset['burndown'])) {
$DataSet->SetSerieName($dataset['burndown']['label'], "Burndown" . $ds_id);
}
}
if (isset($this->values_title)) {
$DataSet->SetYAxisName($this->values_title);
}
if (isset($this->labels_title)) {
$DataSet->SetXAxisName($this->labels_title);
}
// Initialise the graph
$Test = new pChart($this->width, $this->height);
$Test->setFixedScale(0, ceil(max($maxvals) / 5) * 5);
$Test->setFontProperties(THEBUGGENIE_MODULES_PATH . 'pchart' . DS . 'fonts' . DS . 'DroidSans.ttf', 8);
if (isset($this->labels_title)) {
$Test->setGraphArea(50, 30, $this->width - 30, $this->height - 45);
} else {
$Test->setGraphArea(50, 30, $this->width - 30, $this->height - 30);
}
$Test->drawFilledRoundedRectangle(2, 2, $this->width - 3, $this->height - 3, 5, 240, 240, 240);
$Test->drawRoundedRectangle(0, 0, $this->width - 1, $this->height - 1, 5, 230, 230, 230);
$Test->drawGraphArea(255, 255, 255, TRUE);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2);
$Test->drawGrid(4, TRUE, 230, 230, 230, 50);
// Draw the 0 line
$Test->setFontProperties(THEBUGGENIE_MODULES_PATH . 'pchart' . DS . 'fonts' . DS . 'DroidSans.ttf', 6);
$Test->drawTreshold(0, 143, 55, 72, TRUE, TRUE);
// Draw the cubic curve graph
if (isset($this->style) && $this->style == 'curved') {
$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
} elseif (isset($this->style) && $this->style == 'filled_line') {
$Test->drawFilledLineGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 50, true);
} elseif (isset($this->style) && $this->style == 'stacked_bar') {
$Test->drawStackedBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 50, true);
} elseif (isset($this->style) && $this->style == 'single_bar') {
$Test->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), TRUE);
} else {
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
}
if (isset($this->include_plotter) && $this->include_plotter) {
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 2, 255, 255, 255);
}
// Finish the graph
$Test->setFontProperties(THEBUGGENIE_MODULES_PATH . 'pchart' . DS . 'fonts' . DS . 'DroidSans.ttf', 8);
//$Test->drawLegend(600, 30, $DataSet->GetDataDescription(), 255, 255, 255);
$Test->drawLegend(55, 35, $DataSet->GetDataDescription(), 255, 255, 255);
$Test->setFontProperties(THEBUGGENIE_MODULES_PATH . 'pchart' . DS . 'fonts' . DS . 'DroidSansBold.ttf', 10);
$Test->drawTitle(50, 22, $this->title, 50, 50, 50, $this->width - 30);
$Test->Stroke();
//("example2.png");
}
示例7: drawLine
/**
* Draw line style chart
* @return unknown
*/
protected function drawLine()
{
// prepare font & series
$this->_prepareSerie();
$this->_prepareFont();
// init chart params
$outer_w = $this->w - 5;
// Outer frame witdh
$outer_h = $this->h - 5;
// Outer frame heigth
$inner_w = $this->w - 7;
// Inner frame witdh
$inner_h = $this->h - 7;
// Inner frame heigth
$chart_w = $this->w - 150;
// Chart frame witdh
$chart_h = $this->h - 40;
// Chart frame heigth
$title_w = $this->w - 200;
// Title width
$title_h = 45;
// Title height
$legend_w = $chart_w + 30;
// Legend width
$legend_h = 40;
// Legend height
// chart styles
$grid = isset($this->p['grid']) ? $this->p['grid'] : false;
$plot = isset($this->p['plot']) ? $this->p['plot'] : false;
$curve = isset($this->p['curve']) ? $this->p['curve'] : false;
$filled = isset($this->p['filled']) ? $this->p['filled'] : false;
// fill chart
$this->chart->drawBackground(255, 255, 255);
$this->chart->setFontProperties($this->font, 7);
// set font and size
$this->chart->drawRoundedRectangle(5, 5, $outer_w, $outer_h, 10, 230, 230, 230);
// drawRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B)
$this->chart->drawFilledRoundedRectangle(7, 7, $inner_w, $inner_h, 10, 240, 240, 240);
// drawRoundedRectangle($X1,$Y1,$X2,$Y2,$Radius,$R,$G,$B)
$this->chart->setGraphArea(70, 40, $chart_w, $chart_h);
// setGraphArea($X1,$Y1,$X2,$Y2)
$this->chart->drawGraphArea(255, 255, 255, TRUE);
// drawGraphArea($R,$G,$B)
$this->chart->drawScale($this->data->GetData(), $this->data->GetDataDescription(), SCALE_NORMAL, 150, 150, 150, TRUE, 0, 2, $this->margin, $this->skip);
// drawScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$RightScale=FALSE)
$this->data->RemoveSerie('DEFAULT_SCALE');
// clear scale serie for setScale method
// draw grid
if ($grid) {
$this->chart->drawGrid(3, TRUE, 230, 230, 230, 50);
// drawGrid($LineWidth,$Mosaic=TRUE,$R=220,$G=220,$B=220,$Alpha=255)
}
// draw the 0 line
//$this->chart->setFontProperties($this->font,6);
//$this->chart->drawTreshold(0,143,55,72,TRUE,TRUE);
// draw the cubic curve graph
if ($curve) {
$this->chart->drawCubicCurve($this->data->GetData(), $this->data->GetDataDescription());
if ($filled) {
$this->chart->drawFilledCubicCurve($this->data->GetData(), $this->data->GetDataDescription(), 0.1, 50);
// filled cubic curve graph
}
// draw the line graph
} else {
$this->chart->drawLineGraph($this->data->GetData(), $this->data->GetDataDescription());
if ($filled) {
$this->chart->drawFilledLineGraph($this->data->GetData(), $this->data->GetDataDescription(), 50);
}
}
// plot style point
if ($plot) {
$this->chart->drawPlotGraph($this->data->GetData(), $this->data->GetDataDescription(), 3, 2, 255, 255, 255, true);
// drawPlotGraph(&$Data,&$DataDescription,$BigRadius=5,$SmallRadius=2,$R2=-1,$G2=-1,$B2=-1,$Shadow=FALSE)
}
// add Title
$this->chart->setFontProperties($this->font, 10);
$this->chart->drawTitle(40, 0, $this->title, 50, 50, 50, $title_w, $title_h);
// drawTitle($XPos,$YPos,$Value,$R,$G,$B,$XPos2=-1,$YPos2=-1,$Shadow=FALSE)
// add Legend
$this->chart->setFontProperties($this->font, 8);
$this->chart->drawLegend($legend_w, $legend_h, $this->data->GetDataDescription(), 255, 255, 255);
// drawLegend($description,$R,$G,$B)
}
示例8: cartesianChart
//.........这里部分代码省略.........
$xdata .= $settings['XAxisUnit'];
$Position = imageftbbox($FontSize, 0, $FontName, $xdata);
$TextWidth = $Position[2] - $Position[0];
$TextHeightX = $Position[1] - $Position[7];
$WXmax = $TextWidth > $WXmax ? $TextWidth : $WXmax;
}
}
if ($settings['XAngle'] > 0) {
$sin = abs(sin(deg2rad($settings['XAngle'])));
$cos = abs(cos(deg2rad($settings['XAngle'])));
$HXmax = $WXmax * $sin + $TextHeightX * $cos;
} else {
$HXmax = $TextHeightX;
}
//on Y axis...
if ($settings['YAxisFormat'] == 'time') {
$ydata = "99:99:99";
$Position = imageftbbox($FontSize, 0, $FontName, $ydata);
$WYmax = $Position[2] - $Position[0];
$TextHeightY = $Position[1] - $Position[7];
} elseif ($settings['YAxisFormat'] == 'date') {
$ydata = "99/99/9999";
$Position = imageftbbox($FontSize, 0, $FontName, $ydata);
$WYmax = $Position[2] - $Position[0];
$TextHeightY = $Position[1] - $Position[7];
} else {
$WYmax = 0;
foreach ($y as $ydata) {
$ydata .= $settings['YAxisUnit'];
//echo $ydata."<br>";
$Position = imageftbbox($FontSize, 0, $FontName, $ydata);
$TextWidth = $Position[2] - $Position[0];
$TextHeightY = $Position[1] - $Position[7];
$WYmax = $TextWidth > $WYmax ? $TextWidth : $WYmax;
}
}
$Test->setGraphArea($WYmax + $TextHeightY + 35, 20, $w - 25, $h - $HXmax - $TextHeightX - $TextboxHeight - 20);
//$Test->setGraphArea(60,20,$w-25,($settings['XAngle']==0)?$h-70:$h-100);
$Test->drawScale($DataSet->GetData(), $DataSet->GetDataDescription(), SCALE_ADDALL, 213, 217, 221, TRUE, $settings['XAngle'], 0, TRUE);
$Test->drawGraphAreaGradient($settings['BGR'], $settings['BGG'], $settings['BGB'], $settings['Decay2']);
$Test->drawGrid(4, TRUE, 230, 230, 230, 20);
// This will put the picture "logo.png" with transparency
if (strlen($settings['Logo'])) {
$XLogo = $WYmax + $TextHeightY + 35 + $settings['XLogo'];
$YLogo = 20 + $settings['XLogo'];
$logo = $settings['Logo'];
//Fing extension of logo : png,gif or jpg
if ($this->_findexts($logo) == "png") {
echo "png!";
$Test->drawFromPNG($logo, $XLogo, $YLogo, $settings['LogoTransparency']);
} elseif ($this->_findexts($logo) == "gif") {
echo "gif!";
$Test->drawFromGIF($logo, $XLogo, $YLogo, $settings['LogoTransparency']);
} elseif ($this->_findexts($logo) == "jpg") {
echo "jpg";
$Test->drawFromJPG($logo, $XLogo, $YLogo, $settings['LogoTransparency']);
}
}
$Test->setColorPalette(0, $settings['DataR'], $settings['DataG'], $settings['DataB']);
if ($type == "bar") {
// Draw the bar chart
$Test->drawStackedBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 70);
} elseif ($type == "line") {
$Test->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 0, -1, -1, -1, TRUE);
} elseif ($type == "cubic") {
$Test->setShadowProperties(3, 3, 0, 0, 0, 30, 4);
$Test->drawCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription());
$Test->clearShadow();
if ($settings['Filled'] == 'yes') {
$Test->drawFilledCubicCurve($DataSet->GetData(), $DataSet->GetDataDescription(), 0.1, 30);
}
$Test->drawPlotGraph($DataSet->GetData(), $DataSet->GetDataDescription(), 3, 0, -1, -1, -1, TRUE);
}
// Draw the textbox
if (strlen($settings['Textbox'])) {
$Test->setFontProperties($TextboxFontName, $TextboxFontSize);
$Test->drawTextBox(0, $h - $TextboxHeight, $w, $h, $settings['Textbox'], 0, 255, 255, 255, ALIGN_CENTER, TRUE, 0, 0, 0, 30);
}
// Draw the legend
if (strlen($settings['Legend'])) {
$LegendFontSize = $settings['LegendFontSize'];
$LegendFontName = $this->_ext_path . "/fonts/" . $settings['LegendFontName'];
$Position = imageftbbox($LegendFontSize, 0, $LegendFontName, $settings['Legend']);
$LegendW = $Position[2] - $Position[0] + 40;
$Test->setFontProperties($LegendFontName, $LegendFontSize);
$Test->drawLegend($w - $LegendW, 10, $DataSet->GetDataDescription(), $settings['LBR'], $settings['LBG'], $settings['LBB'], 52, 58, 82, $settings['LR'], $settings['LG'], $settings['LB'], TRUE);
}
// Render the picture
$Test->addBorder(2);
if (strlen($imgname)) {
//custom image name
$imgname = $this->_img_path . "/" . $imgname;
} else {
$this->obj->load->helper('string');
$imgname = $this->_img_path . "/{$type}-" . random_string('alnum', 16) . ".png";
}
$Test->Render($imgname);
return array("name" => '/' . $imgname, "w" => $w + 4, "h" => $h + 4);
}