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


PHP ezcGraphColor::darken方法代碼示例

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


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

示例1: drawCircularBar

 /**
  * Draws a bar with a circular ground shape.
  * 
  * @param ezcGraphContext $context
  * @param ezcGraphColor $color
  * @param ezcGraphCoordinate $position
  * @param float $barWidth
  * @param float $offset
  * @param float $axisPosition
  * @param float $startDepth
  * @param float $midDepth
  * @param float $endDepth
  * @param int $symbol
  * @return void
  */
 protected function drawCircularBar(ezcGraphContext $context, ezcGraphColor $color, ezcGraphCoordinate $position, $barWidth, $offset, $axisPosition, $startDepth, $midDepth, $endDepth, $symbol)
 {
     $barCenterTop = new ezcGraphCoordinate($this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ($this->dataBoundings->x1 - ($this->dataBoundings->x0 + 2 * $this->xAxisSpace)) + $offset + $barWidth / 2, $this->dataBoundings->y0 + $this->yAxisSpace + $position->y * ($this->dataBoundings->y1 - ($this->dataBoundings->y0 + 2 * $this->yAxisSpace)));
     $barCenterBottom = new ezcGraphCoordinate($this->dataBoundings->x0 + $this->xAxisSpace + $position->x * ($this->dataBoundings->x1 - ($this->dataBoundings->x0 + 2 * $this->xAxisSpace)) + $offset + $barWidth / 2, $this->dataBoundings->y0 + $this->yAxisSpace + $axisPosition * ($this->dataBoundings->y1 - ($this->dataBoundings->y0 + 2 * $this->yAxisSpace)));
     if ($barCenterTop->y > $barCenterBottom->y) {
         $tmp = $barCenterTop;
         $barCenterTop = $barCenterBottom;
         $barCenterBottom = $tmp;
     }
     $this->barPostProcessing[] = array('index' => $barCenterBottom->x, 'method' => 'drawCircularArc', 'context' => $context, 'parameters' => array($this->get3dCoordinate($barCenterTop, $midDepth), $barWidth, $barWidth / 2, ($barCenterBottom->y - $barCenterTop->y) * $this->yDepthFactor, 0, 180, $color));
     $this->barPostProcessing[] = array('index' => $barCenterBottom->x + 1, 'method' => 'drawCircle', 'context' => $context, 'parameters' => array($top = $this->get3dCoordinate($barCenterTop, $midDepth), $barWidth, $barWidth / 2, $symbol === ezcGraph::CIRCLE ? new ezcGraphLinearGradient(new ezcGraphCoordinate($top->x - $barWidth / 2, $top->y), new ezcGraphCoordinate($top->x + $barWidth / 2, $top->y), $color->darken($this->options->barDarkenTop), $color) : $color));
 }
開發者ID:jordanmanning,項目名稱:ezpublish,代碼行數:27,代碼來源:3d.php

示例2: drawCircularArcStep

 /**
  * Draws a single element of a circular arc
  * 
  * ext/gd itself does not support something like circular arcs, so that
  * this functions draws rectangular polygons as a part of circular arcs
  * to interpolate them. This way it is possible to apply a linear gradient
  * to the circular arc, because we draw single steps anyway.
  *
  * @param ezcGraphCoordinate $center Center of ellipse
  * @param integer $width Width of ellipse
  * @param integer $height Height of ellipse
  * @param integer $size Height of border
  * @param float $startAngle Starting angle of circle sector
  * @param float $endAngle Ending angle of circle sector
  * @param ezcGraphColor $color Color of Border
  * @return void
  */
 protected function drawCircularArcStep(ezcGraphCoordinate $center, $width, $height, $size, $startAngle, $endAngle, ezcGraphColor $color)
 {
     $this->drawPolygon(array(new ezcGraphCoordinate($center->x + cos(deg2rad($startAngle)) * $width / 2, $center->y + sin(deg2rad($startAngle)) * $height / 2), new ezcGraphCoordinate($center->x + cos(deg2rad($startAngle)) * $width / 2, $center->y + sin(deg2rad($startAngle)) * $height / 2 + $size), new ezcGraphCoordinate($center->x + cos(deg2rad($endAngle)) * $width / 2, $center->y + sin(deg2rad($endAngle)) * $height / 2 + $size), new ezcGraphCoordinate($center->x + cos(deg2rad($endAngle)) * $width / 2, $center->y + sin(deg2rad($endAngle)) * $height / 2)), $color->darken($this->options->shadeCircularArc * (1 + cos(deg2rad($startAngle))) / 2), true);
 }
開發者ID:mediasadc,項目名稱:alba,代碼行數:21,代碼來源:gd.php


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