當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Image_Graph_Element::_done方法代碼示例

本文整理匯總了PHP中Image_Graph_Element::_done方法的典型用法代碼示例。如果您正苦於以下問題:PHP Image_Graph_Element::_done方法的具體用法?PHP Image_Graph_Element::_done怎麽用?PHP Image_Graph_Element::_done使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Image_Graph_Element的用法示例。


在下文中一共展示了Image_Graph_Element::_done方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 /**
  * Output the box
  *
  * @return bool Was the output 'good' (true) or 'bad' (false).
  * @access private
  */
 function _done()
 {
     if (parent::_done() === false) {
         return false;
     }
     $this->_canvas->startGroup(get_class($this));
     $this->_getFillStyle();
     $this->_getLineStyle();
     $this->_canvas->rectangle(array('x0' => $this->_left, 'y0' => $this->_top, 'x1' => $this->_right, 'y1' => $this->_bottom));
     $this->_canvas->endGroup();
     return true;
 }
開發者ID:richardmansfield,項目名稱:richardms-mahara,代碼行數:18,代碼來源:Rectangle.php

示例2:

 /**
  * Output the ellipse
  *
  * @return bool Was the output 'good' (true) or 'bad' (false).
  * @access private
  */
 function _done()
 {
     if (parent::_done() === false) {
         return false;
     }
     $this->_canvas->startGroup(get_class($this));
     $this->_getFillStyle();
     $this->_getLineStyle();
     $this->_canvas->ellipse(array('x' => ($this->_left + $this->_right) / 2, 'y' => ($this->_top + $this->_bottom) / 2, 'rx' => $this->width(), 'ry' => $this->height()));
     $this->_canvas->endGroup();
     return true;
 }
開發者ID:villos,項目名稱:tree_admin,代碼行數:18,代碼來源:Ellipse.php

示例3:

 /**
  * Output the polygon
  *
  * @return bool Was the output 'good' (true) or 'bad' (false).
  * @access private
  */
 function _done()
 {
     if (parent::_done() === false) {
         return false;
     }
     $this->_canvas->startGroup(get_class($this));
     $this->_getFillStyle();
     $this->_getLineStyle();
     $this->_canvas->polygon(array('connect' => true));
     $this->_canvas->endGroup();
     return true;
 }
開發者ID:valentijnvenus,項目名稱:geocloud,代碼行數:18,代碼來源:Polygon.php

示例4: array

 /**
  * Output the logo
  *
  * @return bool Was the output 'good' (true) or 'bad' (false).
  * @access private
  */
 function _done()
 {
     if (parent::_done() === false) {
         return false;
     }
     $align = array();
     if ($this->_alignment & IMAGE_GRAPH_ALIGN_LEFT) {
         $x = $this->_parent->_left + 2;
         $align['horizontal'] = 'left';
     } elseif ($this->_alignment & IMAGE_GRAPH_ALIGN_RIGHT) {
         $x = $this->_parent->_right - 2;
         $align['horizontal'] = 'right';
     } else {
         $x = ($this->_parent->_left + $this->_parent->_right) / 2;
         $align['horizontal'] = 'center';
     }
     if ($this->_alignment & IMAGE_GRAPH_ALIGN_TOP) {
         $y = $this->_parent->_top + 2;
         $align['vertical'] = 'top';
     } elseif ($this->_alignment & IMAGE_GRAPH_ALIGN_BOTTOM) {
         $y = $this->_parent->_bottom - 2;
         $align['vertical'] = 'bottom';
     } else {
         $y = ($this->_parent->_top + $this->_parent->_bottom) / 2;
         $align['vertical'] = 'center';
     }
     $this->_canvas->image(array('x' => $x, 'y' => $y, 'filename' => $this->_filename, 'alignment' => $align));
     return true;
 }
開發者ID:Apeplazas,項目名稱:plazadelatecnologia,代碼行數:35,代碼來源:Logo.php

示例5: sprintf

 /**
  * Outputs this graph using the canvas.
  *
  * This causes the graph to make all elements perform their output. Their
  * result is 'written' to the output using the canvas, which also performs
  * the actual output, fx. it being to a file or directly to the browser
  * (in the latter case, the canvas will also make sure the correct HTTP
  * headers are sent, making the browser handle the output correctly, if
  * supported by it).
  *
  * @param mixed $param The output parameters to pass to the canvas
  * @return bool Was the output 'good' (true) or 'bad' (false).
  * @access private
  */
 function _done($param = false)
 {
     $timeStart = $this->_getMicroTime();
     if ($this->_shadow) {
         $this->setPadding(20);
         $this->_setCoords($this->_left, $this->_top, $this->_right - 10, $this->_bottom - 10);
     }
     $result = $this->_updateCoords();
     if (PEAR::isError($result)) {
         return $result;
     }
     if ($this->_getBackground()) {
         $this->_canvas->rectangle(array('x0' => $this->_left, 'y0' => $this->_top, 'x1' => $this->_right, 'y1' => $this->_bottom));
     }
     $result = parent::_done();
     if (PEAR::isError($result)) {
         return $result;
     }
     if ($this->_displayErrors) {
         $this->_displayErrors();
     }
     $timeEnd = $this->_getMicroTime();
     if ($this->_showTime || isset($param['showtime']) && $param['showtime'] === true) {
         $text = 'Generated in ' . sprintf('%0.3f', $timeEnd - $timeStart) . ' sec';
         $this->write($this->_right, $this->_bottom, $text, IMAGE_GRAPH_ALIGN_RIGHT + IMAGE_GRAPH_ALIGN_BOTTOM, array('color' => 'red'));
     }
     if (isset($param['filename'])) {
         if (isset($param['tohtml']) && $param['tohtml']) {
             return $this->_canvas->toHtml($param);
         } else {
             return $this->_canvas->save($param);
         }
     } else {
         return $this->_canvas->show($param);
     }
 }
開發者ID:Apeplazas,項目名稱:plazadelatecnologia,代碼行數:50,代碼來源:Graph.php

示例6: _done

 /**
  * Output the plot
  *
  * @return bool Was the output 'good' (true) or 'bad' (false).
  * @access private
  */
 function _done()
 {
     if (Image_Graph_Element::_done() === false) {
         return false;
     }
     $this->_canvas->startGroup(get_class($this));
     $param = $this->_parameterArray();
     $parent = is_object($this->_parent) ? get_class($this->_parent) : $this->_parent;
     if (strtolower($parent) == 'image_graph_plotarea') {
         $this->_getFillStyle();
         $this->_getLineStyle();
         $this->_canvas->rectangle(array('x0' => $this->_left, 'y0' => $this->_top, 'x1' => $this->_right, 'y1' => $this->_bottom));
         $param = $this->_parameterArray();
         $keys = array_keys($this->_plotareas);
         foreach ($keys as $key) {
             $plotarea =& $this->_plotareas[$key];
             $keys2 = array_keys($plotarea->_elements);
             foreach ($keys2 as $key) {
                 $element =& $plotarea->_elements[$key];
                 if (is_a($element, 'Image_Graph_Plot')) {
                     $element->_legendSample($param);
                 }
             }
             unset($keys2);
         }
         unset($keys);
     } else {
         $param0 = $param;
         $param0['simulate'] = true;
         $keys = array_keys($this->_plotareas);
         foreach ($keys as $key) {
             $plotarea =& $this->_plotareas[$key];
             $keys2 = array_keys($plotarea->_elements);
             foreach ($keys2 as $key) {
                 $element =& $plotarea->_elements[$key];
                 if (is_a($element, 'Image_Graph_Plot')) {
                     $element->_legendSample($param0);
                 }
             }
             unset($keys2);
         }
         unset($keys);
         if (($this->_alignment & IMAGE_GRAPH_ALIGN_VERTICAL) != 0) {
             if ($param0['x'] == $param['x']) {
                 $param['y'] = $param['y'] + ($this->_height() - ($param0['y'] - $param['y'])) / 2;
             }
         } else {
             if ($param0['y'] == $param['y']) {
                 $param['x'] = $param['x'] + ($this->_width() - ($param0['x'] - $param['x'])) / 2;
             }
         }
         $keys = array_keys($this->_plotareas);
         foreach ($keys as $key) {
             $plotarea =& $this->_plotareas[$key];
             $keys2 = array_keys($plotarea->_elements);
             foreach ($keys2 as $key) {
                 $element =& $plotarea->_elements[$key];
                 if (is_a($element, 'Image_Graph_Plot')) {
                     $element->_legendSample($param);
                 }
             }
             unset($keys2);
         }
         unset($keys);
     }
     $this->_canvas->endGroup();
     return true;
 }
開發者ID:chiranjeevjain,項目名稱:agilebill,代碼行數:74,代碼來源:Legend.php

示例7: _done

 /**
  * Output the axis
  *
  * @return bool Was the output 'good' (true) or 'bad' (false).
  * @access private
  */
 function _done()
 {
     $result = true;
     if (Image_Graph_Element::_done() === false) {
         $result = false;
     }
     $this->_canvas->startGroup(get_class($this));
     $this->_drawAxisLines();
     $this->_canvas->startGroup(get_class($this) . '_ticks');
     $label = false;
     while (($label = $this->_getNextLabel($label)) !== false) {
         $this->_drawTick($label);
     }
     $this->_canvas->endGroup();
     $this->_canvas->endGroup();
     return $result;
 }
開發者ID:casati-dolibarr,項目名稱:corebos,代碼行數:23,代碼來源:Category.php

示例8: ImageSX

    /**
     * Output the logo
     * @access private
     */
    function _done()
    {
        parent::_done();
        if (!$this->_image) {
            return false;
        }
        $logoWidth = ImageSX($this->_image);
        $logoHeight = ImageSY($this->_image);
        if ($this->_alignment & IMAGE_GRAPH_ALIGN_LEFT) {
            $x = $this->_parent->_left + 2;
        }
        elseif ($this->_alignment & IMAGE_GRAPH_ALIGN_RIGHT) {
            $x = $this->_parent->_right - $logoWidth - 2;
        } else {
            $x = $this->_parent->_left + ($this->_parent->width() - $logoWidth) / 2;
        }

        if ($this->_alignment & IMAGE_GRAPH_ALIGN_TOP) {
            $y = $this->_parent->_top + 2;
        }
        elseif ($this->_alignment & IMAGE_GRAPH_ALIGN_BOTTOM) {
            $y = $this->_parent->_bottom - $logoHeight - 2;
        } else {
            $y = $this->_parent->_top + ($this->_parent->height() - $logoHeight) / 2;
        }

        ImageCopy($this->_canvas(), $this->_image, $x, $y, 0, 0, $logoWidth, $logoHeight);
    }
開發者ID:Apeplazas,項目名稱:plazadelatecnologia,代碼行數:32,代碼來源:Logo.php

示例9: while

    /**
     * Output the axis
     * @access private
     */
    function _done()
    {
        parent::_done();

        if (!$this->_font) {
            $this->_font = $GLOBALS['_Image_Graph_font'];
        }

        $value = $this->_getNextLabel();
        
        $lastPosition = false;

        $this->_debug("Enumerating values from $value to ".$this->_getMaximum());
        while ($value <= $this->_getMaximum()) {
            if ((((abs($value) > 0.0001) or ($this->_showLabelZero)) and (($value > $this->_getMinimum()) or ($this->_showLabelMinimum)) and (($value < $this->_getMaximum()) or ($this->_showLabelMaximum))) and ($value>= $this->_getMinimum()) and ($value<= $this->_getMaximum())) {
                $labelPosition = $this->_point($value);

                if (is_object($this->_dataPreProcessor)) {
                    $labelText = $this->_dataPreProcessor->_process($value);
                } else {
                    $labelText = $value;
                }

                $doOutput = false;
                if ($this->_type == IMAGE_GRAPH_AXIS_Y) {
                    $text = new Image_Graph_Text($this->_right - 3, $labelPosition, $labelText, $this->_font);
                    $text->setAlignment(IMAGE_GRAPH_ALIGN_CENTER_Y | IMAGE_GRAPH_ALIGN_RIGHT);
                    
                    if (($text->_fillBottom() < $lastPosition) or ($lastPosition === false)) {
                        $lastPosition = $text->_fillTop();
                        $doOutput = true;
                    }
                } else {
                    $text = new Image_Graph_Text($labelPosition, $this->_top + 3, $labelText, $this->_font);
                    $text->setAlignment(IMAGE_GRAPH_ALIGN_CENTER_X | IMAGE_GRAPH_ALIGN_TOP);

                    if (($text->_fillLeft() > $lastPosition) or ($lastPosition === false)) {
                        $lastPosition = $text->_fillRight();
                        $doOutput = true;
                    }
                }

                if ($doOutput) {
                    $this->add($text);
                    $text->_done();
                }

                if ($this->_type == IMAGE_GRAPH_AXIS_Y) {
                    ImageLine($this->_canvas(), $this->_right, $labelPosition, $this->_right + 6, $labelPosition, $this->_getLineStyle());
                } else {
                    ImageLine($this->_canvas(), $labelPosition, $this->_top, $labelPosition, $this->_top - 6, $this->_getLineStyle());
                }
            }

            $nextValue = $this->_getNextLabel($value);
/*            if ($minorLabelInterval = $this->_minorLabelInterval()) {
                $minorValue = $value + $minorLabelInterval;
                while (($minorValue < $nextValue) and ($minorValue < $this->_getMaximum() - $minorLabelInterval)) {
                    if ($minorValue >= $this->_getMinimum()) {
                        $position = $this->_point($minorValue);
                        if ($this->_type == IMAGE_GRAPH_AXIS_Y) {
                            ImageLine($this->_canvas(), $this->_right, $position, $this->_right + 3, $position, $this->_getLineStyle());
                        } else {
                            ImageLine($this->_canvas(), $position, $this->_top, $position, $this->_top - 3, $this->_getLineStyle());
                        }
                    }

                    $minorValue += $minorLabelInterval;
                }
            }*/

            $value = $nextValue;
        }

        if ($this->_type == IMAGE_GRAPH_AXIS_Y) {
            ImageLine($this->_canvas(), $this->_right, $this->_top, $this->_right, $this->_bottom, $this->_getLineStyle());
            if ($this->_showArrow) {
                $arrow[] = $this->_right - 5;
                $arrow[] = $this->_top + 8;
                $arrow[] = $this->_right;
                $arrow[] = $this->_top;
                $arrow[] = $this->_right + 5;
                $arrow[] = $this->_top + 8;
                ImageFilledPolygon($this->_canvas(), $arrow, count($arrow) / 2, $this->_getFillStyle());
                ImagePolygon($this->_canvas(), $arrow, count($arrow) / 2, $this->_getLineStyle());
            }
        } else {
            ImageLine($this->_canvas(), $this->_left, $this->_top, $this->_right, $this->_top, $this->_getLineStyle());
            if ($this->_showArrow) {
                $arrow[] = $this->_right - 8;
                $arrow[] = $this->_top + 5;
                $arrow[] = $this->_right;
                $arrow[] = $this->_top;
                $arrow[] = $this->_right - 8;
                $arrow[] = $this->_top - 5;
                ImageFilledPolygon($this->_canvas(), $arrow, count($arrow) / 2, $this->_getFillStyle());
//.........這裏部分代碼省略.........
開發者ID:hungnv0789,項目名稱:vhtm,代碼行數:101,代碼來源:Axis.php

示例10: ImageFilledRectangle

    /**
     * Output to the canvas
     * @param int $type The type of image to output, i.e. IMG_PNG (default) and IMG_JPEG
     * @access private
     */
    function _done($type = IMG_PNG)
    {
        $timeStart = $this->_getMicroTime();
        $this->_debug("Output started $timeStart");
        
        if ($this->_shadow) {
            $this->setPadding(20);
            $this->_setCoords($this->_left, $this->_top, $this->_right -10, $this->_bottom-10);
        }

        $this->_updateCoords();
        

        if ($this->_fillStyle) {
            ImageFilledRectangle($this->_canvas(), $this->_left, $this->_top, $this->_right, $this->_bottom, $this->_getFillStyle());
        }

        if (!file_exists(dirname(__FILE__)."/Graph/Images/logo.png")) {
            $error = "Could not find Logo your installation may be incomplete";
            ImageLine($this->_canvas(), 0, 0, $this->width(), $this->height(), $this->_color(IMAGE_GRAPH_RED));
            ImageLine($this->_canvas(), $this->width(), 0, 0, $this->height(), $this->_color(IMAGE_GRAPH_RED));
            ImageString($this->_canvas(), IMAGE_GRAPH_FONT, ($this->width() - ImageFontWidth(IMAGE_GRAPH_FONT) * strlen($error)) / 2, ($this->height() - ImageFontHeight(IMAGE_GRAPH_FONT)) / 2, $error, $this->_color(IMAGE_GRAPH_RED));
        } else {
            parent::_done();
        }
        
        if (isset($this->_borderStyle)) {
            $this->_debug("Drawing border");
            ImageRectangle($this->_canvas(), $this->_left, $this->_top, $this->_right, $this->_bottom, $this->_getBorderStyle());
        }

        if (($this->_outputImage) and (!IMAGE_GRAPH_DEBUG)) {
            header("Expires: Tue, 2 Jul 1974 17:41:00 GMT"); // Date in the past
            header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); // always modified
            header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
            header("Pragma: no-cache");
            header("Content-type: image/". ($type == IMG_JPG ? "jpeg" : "png"));            
            header("Content-Disposition: attachment; filename = \"". (isset($_GET['thumb']) ? $_GET['thumb'] : (isset($_GET['image']) ? $_GET['image'] : ""))."\"");
        }

        if ($this->_rotation) {
            $this->_canvas = ImageRotate($this->_canvas(), $this->_rotation, $this->_getFillStyle());
        }

        $timeEnd = $this->_getMicroTime();
        $this->_debug("Output ended $timeEnd");

        if ($this->_showTime) {
            ImageString($this->_canvas(), FONT, $this->_left + $this->width() * 0.15, $this->_bottom - $this->_height * 0.1 - ImageFontHeight(IMAGE_GRAPH_FONT), "Generated in ".sprintf("%0.3f", $timeEnd - $timeStart)." sec", $this->_color(IMAGE_GRAPH_RED));
        }

        if (!$this->_hideLogo) {
            $logo = new Image_Graph_Logo(dirname(__FILE__)."/Graph/Images/logo.png", IMAGE_GRAPH_ALIGN_TOP_RIGHT);
            $logo->_setParent($this);
            $logo->_done();
        }

        if ($this->_antialias) {
            $this->_performAntialias();
        }

        if ($this->_fileName) {
            if (strtolower(substr($this->_fileName, -4)) == ".png") {
                ImagePNG($this->_canvas(), $this->_fileName);
            } else {
                ImageJPEG($this->_canvas(), $this->_fileName);
            }
        }

        if (($this->_thumbWidth) and ($this->_thumbHeight)) {
            if (isset($GLOBALS['_Image_Graph_gd2'])) {
                $thumbnail = ImageCreateTrueColor($this->_thumbWidth, $this->_thumbHeight);
                ImageCopyResampled($thumbnail, $this->_canvas(), 0, 0, 0, 0, $this->_thumbWidth, $this->_thumbHeight, $this->width(), $this->height());
            } else {
                $thumbnail = ImageCreate($this->_thumbWidth, $this->_thumbHeight);
                ImageCopyResized($thumbnail, $this->_canvas(), 0, 0, 0, 0, $this->_thumbWidth, $this->_thumbHeight, $this->width(), $this->height());
            }

            if ($this->_thumbFileName) {
                if (strtolower(substr($this->_thumbFileName, -4)) == ".png") {
                    ImagePNG($thumbnail, $this->_thumbFileName);
                } else {
                    ImageJPEG($thumbnail, $this->_thumbFileName);
                }
                ImageDestroy($thumbnail);
            } else {
                ImageDestroy($this->_canvas());
                $this->_canvas = $thumbnail;
            }
        }
	
        if (($this->_outputImage) and (!IMAGE_GRAPH_DEBUG)) {
            if ($type == IMG_JPG) {
                ImageJPEG($this->_canvas());
            } else {
//.........這裏部分代碼省略.........
開發者ID:hungnv0789,項目名稱:vhtm,代碼行數:101,代碼來源:Graph.php

示例11:

 /**
  * Output the text 
  * @access private
  */
 function _done()
 {
     if (!$this->_font) {
         return false;
     }
     parent::_done();
     $this->_font->_write($this->_fillLeft(), $this->_fillTop(), $this->_text);
 }
開發者ID:hungnv0789,項目名稱:vhtm,代碼行數:12,代碼來源:Text.php


注:本文中的Image_Graph_Element::_done方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。