function Stroke($aFileName = '') { // Find out the necessary size for the container image $w = 0; $h = 0; for ($i = 0; $i < $this->iCnt; ++$i) { $maxw = $this->iGraphs[$i][1] + $this->iGraphs[$i][5]; $maxh = $this->iGraphs[$i][2] + $this->iGraphs[$i][6]; $w = max($w, $maxw); $h = max($h, $maxh); } $w += $this->lm + $this->rm; $h += $this->tm + $this->bm; // User specified width,height overrides if ($this->iWidth !== NULL && $this->iWidth !== 0) { $w = $this->iWidth; } if ($this->iHeight !== NULL && $this->iHeight !== 0) { $h = $this->iHeight; } if ($this->doshadow) { $w += $this->shadow_width; $h += $this->shadow_width; } $image = new Image($w, $h); $image->SetImgFormat($this->image_format, $this->image_quality); if ($this->doshadow) { $image->SetColor($this->iFrameColor); $image->ShadowRectangle(0, 0, $w - 1, $h - 1, $this->iFillColor, $this->shadow_width, $this->shadow_color); $w -= $this->shadow_width; $h -= $this->shadow_width; } else { $image->SetColor($this->iFillColor); $image->FilledRectangle(0, 0, $w - 1, $h - 1); } $image->SetExpired($this->expired); $this->img = $image->img; $this->_strokeBackgroundImage(); if ($this->iDoFrame && !$this->doshadow) { $image->SetColor($this->iFrameColor); $image->SetLineWeight($this->iFrameWeight); $image->Rectangle(0, 0, $w - 1, $h - 1); } // Copy all sub graphs to the container for ($i = 0; $i < $this->iCnt; ++$i) { $image->CopyMerge($this->iGraphs[$i][0], $this->iGraphs[$i][1] + $this->lm, $this->iGraphs[$i][2] + $this->tm, $this->iGraphs[$i][3], $this->iGraphs[$i][4], $this->iGraphs[$i][5], $this->iGraphs[$i][6], -1, -1, $this->iGraphs[$i][7]); } $this->StrokeTitle($image, $w, $h); $this->footer->Stroke($image); // Output image if ($aFileName == _IMG_HANDLER) { return $image->img; } else { //Finally stream the generated picture $this->cache = new ImgStreamCache(); $this->cache->PutAndStream($image, $this->cache_name, $this->inline, $aFileName); } }
function Rectangle($x1, $y1, $x2, $y2) { // Rectangle uses Line() so it will be rotated through that call parent::Rectangle($x1, $y1, $x2, $y2); }
function Stroke($aFileName = '') { // Find out the necessary size for the container image $w = 0; $h = 0; for ($i = 0; $i < $this->iCnt; ++$i) { $maxw = $this->iGraphs[$i][1] + $this->iGraphs[$i][5]; $maxh = $this->iGraphs[$i][2] + $this->iGraphs[$i][6]; $w = max($w, $maxw); $h = max($h, $maxh); } $w += $this->lm + $this->rm; $h += $this->tm + $this->bm; // User specified width,height overrides if ($this->iWidth !== NULL && $this->iWidth !== 0) { $w = $this->iWidth; } if ($this->iHeight !== NULL && $this->iHeight !== 0) { $h = $this->iHeight; } $image = new Image($w, $h); $image->SetImgFormat($this->image_format, $this->image_quality); $image->SetColor($this->iFillColor); $image->FilledRectangle(0, 0, $w - 1, $h - 1); $image->SetExpired($this->expired); $this->img = $image->img; $this->_strokeBackgroundImage(); if ($this->iDoFrame) { $image->SetColor($this->iFrameColor); $image->SetLineWeight($this->iFrameWeight); $image->Rectangle(0, 0, $w - 1, $h - 1); } // Copy all sub graphs to the container for ($i = 0; $i < $this->iCnt; ++$i) { $image->CopyMerge($this->iGraphs[$i][0], $this->iGraphs[$i][1] + $this->lm, $this->iGraphs[$i][2] + $this->tm, $this->iGraphs[$i][3], $this->iGraphs[$i][4], $this->iGraphs[$i][5], $this->iGraphs[$i][6], -1, -1, $this->iGraphs[$i][7]); } // Stroke title if ($this->title->t !== '') { $margin = 3; $y = $this->title->margin; if ($this->title->halign == 'center') { $this->title->Center(0, $w, $y); } elseif ($this->title->halign == 'left') { $this->title->SetPos($this->title->margin + 2, $y); } elseif ($this->title->halign == 'right') { $indent = 0; if ($this->doshadow) { $indent = $this->shadow_width + 2; } $this->title->SetPos($w - $this->title->margin - $indent, $y, 'right'); } $this->title->Stroke($image); // ... and subtitle $y += $this->title->GetTextHeight($image) + $margin + $this->subtitle->margin; if ($this->subtitle->halign == 'center') { $this->subtitle->Center(0, $w, $y); } elseif ($this->subtitle->halign == 'left') { $this->subtitle->SetPos($this->subtitle->margin + 2, $y); } elseif ($this->subtitle->halign == 'right') { $indent = 0; if ($this->doshadow) { $indent = $this->shadow_width + 2; } $this->subtitle->SetPos($this->img->width - $this->subtitle->margin - $indent, $y, 'right'); } $this->subtitle->Stroke($image); // ... and subsubtitle $y += $this->subtitle->GetTextHeight($image) + $margin + $this->subsubtitle->margin; if ($this->subsubtitle->halign == 'center') { $this->subsubtitle->Center(0, $w, $y); } elseif ($this->subsubtitle->halign == 'left') { $this->subsubtitle->SetPos($this->subsubtitle->margin + 2, $y); } elseif ($this->subsubtitle->halign == 'right') { $indent = 0; if ($this->doshadow) { $indent = $this->shadow_width + 2; } $this->subsubtitle->SetPos($w - $this->subsubtitle->margin - $indent, $y, 'right'); } $this->subsubtitle->Stroke($image); } // Output image if ($aFileName == _IMG_HANDLER) { return $image->img; } else { //Finally stream the generated picture $this->cache = new ImgStreamCache(); $this->cache->PutAndStream($image, $this->cache_name, $this->inline, $aFileName); } }
function Raise($aMsg, $aHalt = true) { $img_iconerror = 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaV' . 'BMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/' . 'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpY' . 'iYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea' . 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx' . 'IAAAsSAdLdfvwAAAAHdElNRQfTBgISOCqusfs5AAABLUlEQVR4' . '2tWV3XKCMBBGWfkranCIVClKLd/7P2Q3QsgCxjDTq+6FE2cPH+' . 'xJ0Ogn2lQbsT+Wrs+buAZAV4W5T6Bs0YXBBwpKgEuIu+JERAX6' . 'wM2rHjmDdEITmsQEEmWADgZm6rAjhXsoMGY9B/NZBwJzBvn+e3' . 'wHntCAJdGu9SviwIwoZVDxPB9+Rc0TSEbQr0j3SA1gwdSn6Db0' . '6Tm1KfV6yzWGQO7zdpvyKLKBDmRFjzeB3LYgK7r6A/noDAfjtS' . 'IXaIzbJSv6WgUebTMV4EoRB8a2mQiQjgtF91HdKDKZ1gtFtQjk' . 'YcWaR5OKOhkYt+ZsTFdJRfPAApOpQYJTNHvCRSJR6SJngQadfc' . 'vd69OLMddVOPCGVnmrFD8bVYd3JXfxXPtLR/+mtv59/ALWiiMx' . 'qL72fwAAAABJRU5ErkJggg=='; if (function_exists('imagetypes')) { $supported = imagetypes(); } else { $supported = 0; } if (!function_exists('imagecreatefromstring')) { $supported = 0; } if (ob_get_length() || headers_sent() || !($supported & IMG_PNG)) { // Special case for headers already sent or that the installation doesn't support // the PNG format (which the error icon is encoded in). // Dont return an image since it can't be displayed echo $this->iTitle . ' ' . $aMsg . '\\n'; return; } $aMsg = wordwrap($aMsg, 55); $lines = substr_count($aMsg, '\\n'); // Create the error icon GD $erricon = imagecreatefromstring(base64_decode($img_iconerror)); // Create an image that contains the error text. $w = 400; $h = 100 + 15 * max(0, $lines - 3); $img = new Image($w, $h); // Drop shadow $img->SetColor('gray'); $img->FilledRectangle(5, 5, $w - 1, $h - 1, 10); $img->SetColor('gray:0.7'); $img->FilledRectangle(5, 5, $w - 3, $h - 3, 10); // Window background $img->SetColor(array(188, 209, 193)); $img->FilledRectangle(1, 1, $w - 5, $h - 5); $img->CopyCanvasH($img->img, $erricon, 5, 30, 0, 0, 40, 40); // Window border $img->SetColor('black'); $img->Rectangle(1, 1, $w - 5, $h - 5); $img->Rectangle(0, 0, $w - 4, $h - 4); // Window top row $img->SetColor('darkred'); for ($y = 3; $y < 18; $y += 2) { $img->Line(1, $y, $w - 6, $y); } // 'White shadow' $img->SetColor('white'); // Left window edge $img->Line(2, 2, 2, $h - 5); $img->Line(2, 2, $w - 6, 2); // 'Gray button shadow' $img->SetColor('darkgray'); // Gray window shadow $img->Line(2, $h - 6, $w - 5, $h - 6); $img->Line(3, $h - 7, $w - 5, $h - 7); // Window title $m = floor($w / 2 - 5); $l = 100; $img->SetColor('lightgray:1.3'); $img->FilledRectangle($m - $l, 2, $m + $l, 16); // Stroke text $img->SetColor('darkred:0.9'); $img->SetFont(FF_FONT2, FS_BOLD); $img->StrokeText($m - 70, 15, $this->iTitle); $img->SetColor('black'); $img->SetFont(FF_FONT1, FS_NORMAL); $txt = new Text($aMsg, 52, 25); $txt->Align('left', 'top'); $txt->Stroke($img); if ($this->iDest) { $img->Stream($this->iDest); } else { $img->Headers(); $img->Stream(); } }
function StrokeTitles() { $margin = 3; if ($this->titlebackground) { // Find out height $this->title->margin += 2; $h = $this->title->GetTextHeight($this->img) + $this->title->margin + $margin; if ($this->subtitle->t != '' && !$this->subtitle->hide) { $h += $this->subtitle->GetTextHeight($this->img) + $margin + $this->subtitle->margin; $h += 2; } if ($this->subsubtitle->t != '' && !$this->subsubtitle->hide) { $h += $this->subsubtitle->GetTextHeight($this->img) + $margin + $this->subsubtitle->margin; $h += 2; } $this->img->PushColor($this->titlebackground_color); if ($this->titlebackground_style === TITLEBKG_STYLE1) { // Inside the frame if ($this->framebevel) { $x1 = $y1 = $this->framebeveldepth + 1; $x2 = $this->img->width - $this->framebeveldepth - 2; $this->title->margin += $this->framebeveldepth + 1; $h += $y1; $h += 2; } else { $x1 = $y1 = $this->frame_weight; $x2 = $this->img->width - $this->frame_weight - 1; } } elseif ($this->titlebackground_style === TITLEBKG_STYLE2) { // Cover the frame as well $x1 = $y1 = 0; $x2 = $this->img->width - 1; } elseif ($this->titlebackground_style === TITLEBKG_STYLE3) { // Cover the frame as well (the difference is that // for style==3 a bevel frame border is on top // of the title background) $x1 = $y1 = 0; $x2 = $this->img->width - 1; $h += $this->framebeveldepth; $this->title->margin += $this->framebeveldepth; } else { JpGraphError::RaiseL(25043); //('Unknown title background style.'); } if ($this->titlebackground_framestyle === 3) { $h += $this->titlebackground_bevelheight * 2 + 1; $this->title->margin += $this->titlebackground_bevelheight; } if ($this->doshadow) { $x2 -= $this->shadow_width; } $indent = 0; if ($this->titlebackground_framestyle == TITLEBKG_FRAME_BEVEL) { $indent = $this->titlebackground_bevelheight; } if ($this->titlebkg_fillstyle == TITLEBKG_FILLSTYLE_HSTRIPED) { $this->img->FilledRectangle2($x1 + $indent, $y1 + $indent, $x2 - $indent, $h - $indent, $this->titlebkg_scolor1, $this->titlebkg_scolor2); } elseif ($this->titlebkg_fillstyle == TITLEBKG_FILLSTYLE_VSTRIPED) { $this->img->FilledRectangle2($x1 + $indent, $y1 + $indent, $x2 - $indent, $h - $indent, $this->titlebkg_scolor1, $this->titlebkg_scolor2, 2); } else { // Solid fill $this->img->FilledRectangle($x1, $y1, $x2, $h); } $this->img->PopColor(); $this->img->PushColor($this->titlebackground_framecolor); $this->img->SetLineWeight($this->titlebackground_frameweight); if ($this->titlebackground_framestyle == TITLEBKG_FRAME_FULL) { // Frame background $this->img->Rectangle($x1, $y1, $x2, $h); } elseif ($this->titlebackground_framestyle == TITLEBKG_FRAME_BOTTOM) { // Bottom line only $this->img->Line($x1, $h, $x2, $h); } elseif ($this->titlebackground_framestyle == TITLEBKG_FRAME_BEVEL) { $this->img->Bevel($x1, $y1, $x2, $h, $this->titlebackground_bevelheight); } $this->img->PopColor(); // This is clumsy. But we neeed to stroke the whole graph frame if it is // set to bevel to get the bevel shading on top of the text background if ($this->framebevel && $this->doframe && $this->titlebackground_style === 3) { $this->img->Bevel(1, 1, $this->img->width - 2, $this->img->height - 2, $this->framebeveldepth, $this->framebevelcolor1, $this->framebevelcolor2); if ($this->framebevelborder) { $this->img->SetColor($this->framebevelbordercolor); $this->img->Rectangle(0, 0, $this->img->width - 1, $this->img->height - 1); } } } // Stroke title $y = $this->title->margin; if ($this->title->halign == 'center') { $this->title->Center(0, $this->img->width, $y); } elseif ($this->title->halign == 'left') { $this->title->SetPos($this->title->margin + 2, $y); } elseif ($this->title->halign == 'right') { $indent = 0; if ($this->doshadow) { $indent = $this->shadow_width + 2; } $this->title->SetPos($this->img->width - $this->title->margin - $indent, $y, 'right'); } $this->title->Stroke($this->img); // ... and subtitle $y += $this->title->GetTextHeight($this->img) + $margin + $this->subtitle->margin; if ($this->subtitle->halign == 'center') { $this->subtitle->Center(0, $this->img->width, $y); } elseif ($this->subtitle->halign == 'left') { $this->subtitle->SetPos($this->subtitle->margin + 2, $y); } elseif ($this->subtitle->halign == 'right') { $indent = 0; if ($this->doshadow) { $indent = $this->shadow_width + 2; } $this->subtitle->SetPos($this->img->width - $this->subtitle->margin - $indent, $y, 'right'); } $this->subtitle->Stroke($this->img); // ... and subsubtitle $y += $this->subtitle->GetTextHeight($this->img) + $margin + $this->subsubtitle->margin; if ($this->subsubtitle->halign == 'center') { $this->subsubtitle->Center(0, $this->img->width, $y); } elseif ($this->subsubtitle->halign == 'left') { $this->subsubtitle->SetPos($this->subsubtitle->margin + 2, $y); } elseif ($this->subsubtitle->halign == 'right') { $indent = 0; if ($this->doshadow) { $indent = $this->shadow_width + 2; } $this->subsubtitle->SetPos($this->img->width - $this->subsubtitle->margin - $indent, $y, 'right'); } $this->subsubtitle->Stroke($this->img); // ... and fancy title $this->tabtitle->Stroke($this->img); }
function Stroke(&$aImg) { $scaling = $this->iAntiAlias ? 2 : 1; $value = new Text(); $value->SetFont($this->iFontFamily, $this->iFontStyle, $this->iFontSize * $scaling); $value->SetColor($this->iFontColor); $n = count($this->iLabels); if ($n > 0) { $maxh = 0; $maxw = 0; foreach ($this->iLabels as $key => $lbl) { $value->Set($lbl); $maxh = max($maxh, $value->GetHeight($aImg)); $maxw = max($maxw, $value->GetWidth($aImg) / 2); } } else { $value->Set("180.8"); $maxh = $value->GetHeight($aImg); $maxw = $value->GetWidth($aImg); } $maxh += round($this->iFontSize * $scaling * 0.5); $maxw += round($this->iFontSize * $scaling * 0.5); $valxmarg = 2 * $maxw + 2 * $this->iLabelMargin * $scaling; $valymarg = 2 * $maxh + 2 * $this->iLabelMargin * $scaling; $w = round($this->iSize * $scaling + $valxmarg); $legendwidth = $this->_StrokeLegend($aImg, 0, 0, $scaling, true) + 10 * $scaling; $w = max($w, $legendwidth); $legendheight = round($this->legend->iShow ? 1 : 0); $legendheight *= max($this->legend->iCircleRadius * 2, $this->legend->iTxtFontSize * 2) + $this->legend->iMargin + $this->legend->iBottomMargin + 2; $legendheight *= $scaling; $h = round($this->iSize * $scaling + $valymarg) + $legendheight; if ($this->iAntiAlias) { $dblImg = new Image($w, $h); $dblImg->SetColor($this->iColor); $dblImg->FilledRectangle(0, 0, $w, $h); } else { $dblImg =& $aImg; $dblImg->SetTranslation($this->iX - $w / 2, $this->iY - $h / 2); } if (__DEBUG) { $dblImg->SetColor('red'); $dblImg->Rectangle(0, 0, $w - 1, $h - 1); } $dblImg->SetColor('black'); if ($this->iShowBox) { $dblImg->SetColor($this->iBoxColor); $dblImg->SetLineWeight($this->iBoxWeight); $dblImg->Rectangle(0, 0, $w - 1, $h - 1); $dblImg->SetLineWeight(1); } $xc = round($w / 2); $yc = round(($h - $legendheight) / 2); $this->iSize *= $scaling; $ri = $this->iCenterSize / 2; $r = round($this->iSize / 2); $n = $this->scale->GetNumCirc(); $ri *= $scaling; $rr = round(($r - $ri) / $n); for ($i = 1; $i <= $n; ++$i) { $this->_ThickCircle($dblImg, $xc, $yc, $rr * $i + $ri, $this->iCircGridWeight, $this->iGridColor1); } $num = 0; if ($this->iType == WINDROSE_TYPEFREE) { $this->_StrokeFreeRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri); } else { if ($this->iOrdinalEncoding == KEYENCODING_CLOCKWISE) { if ($this->iType == WINDROSE_TYPE16) { $const1 = 19; $const2 = 16; } elseif ($this->iType == WINDROSE_TYPE8) { $const1 = 9; $const2 = 8; } else { $const1 = 4; $const2 = 4; } $tmp = array(); $n = count($this->iData); foreach ($this->iData as $key => $val) { if (is_numeric($key)) { $key = ($const1 - $key) % $const2; } $tmp[$key] = $val; } $this->iData = $tmp; } $this->_StrokeRegularRose($dblImg, $value, $scaling, $xc, $yc, $r, $ri); } $this->scale->iFontSize *= $scaling; $this->scale->iZFontSize *= $scaling; $this->scale->StrokeLabels($dblImg, $xc, $yc, $ri, $rr); $this->_ThickCircle($dblImg, $xc, $yc, $ri, $this->iCircGridWeight, $this->iGridColor1); $ww = $w / $scaling; $hh = $h / $scaling; if ($ww > $aImg->width) { JpgraphError::RaiseL(22020); } $x = $xc; $y = $h; $this->_StrokeLegend($dblImg, $x, $y, $scaling); if ($this->iAntiAlias) { $aImg->Copy($dblImg->img, $this->iX - $ww / 2, $this->iY - $hh / 2, 0, 0, $ww, $hh, $w, $h); } $aImg->SetTranslation(0, 0); }
function Raise($aMsg, $aHalt = true) { if (headers_sent()) { // Special case for headers already sent error. Dont // return an image since it can't be displayed // adie("<b>JpGraph Error:</b> ".$aMsg); new Dialog($aMsg); return false; } $w = 450; $h = 110; $img = new Image($w, $h); $img->SetColor("darkred"); $img->Rectangle(0, 0, $w - 1, $h - 1); $img->SetFont(FF_FONT1, FS_BOLD); $img->StrokeText(10, 20, "JpGraph Error:"); $img->SetColor("black"); $img->SetFont(FF_FONT1, FS_NORMAL); $txt = new Text($this->InsertLineBreaks($aMsg), 10, 20); $txt->Align("left", "top"); $txt->Stroke($img); $img->Headers(); $img->Stream(); //adie(); }
function Raise($aMsg, $aHalt = true) { $img_iconerror = 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaV' . 'BMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/' . 'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpY' . 'iYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea' . 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx' . 'IAAAsSAdLdfvwAAAAHdElNRQfTBgISOCqusfs5AAABLUlEQVR4' . '2tWV3XKCMBBGWfkranCIVClKLd/7P2Q3QsgCxjDTq+6FE2cPH+' . 'xJ0Ogn2lQbsT+Wrs+buAZAV4W5T6Bs0YXBBwpKgEuIu+JERAX6' . 'wM2rHjmDdEITmsQEEmWADgZm6rAjhXsoMGY9B/NZBwJzBvn+e3' . 'wHntCAJdGu9SviwIwoZVDxPB9+Rc0TSEbQr0j3SA1gwdSn6Db0' . '6Tm1KfV6yzWGQO7zdpvyKLKBDmRFjzeB3LYgK7r6A/noDAfjtS' . 'IXaIzbJSv6WgUebTMV4EoRB8a2mQiQjgtF91HdKDKZ1gtFtQjk' . 'YcWaR5OKOhkYt+ZsTFdJRfPAApOpQYJTNHvCRSJR6SJngQadfc' . 'vd69OLMddVOPCGVnmrFD8bVYd3JXfxXPtLR/+mtv59/ALWiiMx' . 'qL72fwAAAABJRU5ErkJggg=='; if (function_exists("imagetypes")) { $supported = imagetypes(); } else { $supported = 0; } if (!function_exists('imagecreatefromstring')) { $supported = 0; } if (ob_get_length() || headers_sent() || !($supported & IMG_PNG)) { die($this->iTitle . ' ' . $aMsg); } $aMsg = wordwrap($aMsg, 55); $lines = substr_count($aMsg, "\n"); $erricon = Image::CreateFromString(base64_decode($img_iconerror)); $w = 400; $h = 100 + 15 * max(0, $lines - 3); $img = new Image($w, $h); $img->SetColor("gray"); $img->FilledRectangle(5, 5, $w - 1, $h - 1, 10); $img->SetColor("gray:0.7"); $img->FilledRectangle(5, 5, $w - 3, $h - 3, 10); $img->SetColor("lightblue"); $img->FilledRectangle(1, 1, $w - 5, $h - 5); $img->CopyCanvasH($img->img, $erricon, 5, 30, 0, 0, 40, 40); $img->SetColor("black"); $img->Rectangle(1, 1, $w - 5, $h - 5); $img->Rectangle(0, 0, $w - 4, $h - 4); $img->SetColor("darkred"); for ($y = 3; $y < 18; $y += 2) { $img->Line(1, $y, $w - 6, $y); } $img->SetColor("white"); $img->Line(2, 2, 2, $h - 5); $img->Line(2, 2, $w - 6, 2); $img->SetColor("darkgray"); $img->Line(2, $h - 6, $w - 5, $h - 6); $img->Line(3, $h - 7, $w - 5, $h - 7); $m = floor($w / 2 - 5); $l = 100; $img->SetColor("lightgray:1.3"); $img->FilledRectangle($m - $l, 2, $m + $l, 16); $img->SetColor("darkred"); $img->SetFont(FF_FONT2, FS_BOLD); $img->StrokeText($m - 50, 15, $this->iTitle); $img->SetColor("black"); $img->SetFont(FF_FONT1, FS_NORMAL); $txt = new Text($aMsg, 52, 25); $txt->Align("left", "top"); $txt->Stroke($img); if ($this->iDest) { $img->Stream($this->iDest); } else { $img->Headers(); $img->Stream(); } if ($aHalt) { die; } }
function Rectangle($x1, $y1, $x2, $y2) { // Rectangle uses Line() so it will be rotated through that call parent::Rectangle($x1, $y1, $x2, $y2); //$this->Polygon(array($x1,$y1,$x2,$y1,$x2,$y2,$x1,$y2,$x1,$y1)); }
function Rectangle($x1, $y1, $x2, $y2) { parent::Rectangle($x1, $y1, $x2, $y2); }
function Raise($aMsg, $aHalt = true) { $w = 450; $h = 110; $img = new Image($w, $h); $img->SetColor("darkred"); $img->Rectangle(0, 0, $w - 1, $h - 1); $img->SetFont(FF_FONT1, FS_BOLD); $img->StrokeText(10, 20, "JpGraph Error:"); $img->SetColor("black"); $img->SetFont(FF_FONT1, FS_NORMAL); $txt = new Text($this->InsertLineBreaks($aMsg), 10, 20); $txt->Align("left", "top"); $txt->Stroke($img); $img->Headers(); $img->Stream(); die; }