本文整理匯總了PHP中Image_Graph_Element::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Image_Graph_Element::__construct方法的具體用法?PHP Image_Graph_Element::__construct怎麽用?PHP Image_Graph_Element::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Image_Graph_Element
的用法示例。
在下文中一共展示了Image_Graph_Element::__construct方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
/**
* Create the text
* @param int $x The X position (horizontal) position of the text (center point) on the canvas
* @param int $y The Y position (vertical) position of the text (center point) on the canvas
* @param string $text The text to display
* @param Font $font The font to use in printing
*/
function &Image_Graph_Text($x, $y, $text, & $font)
{
parent::__construct();
$this->_alignment = IMAGE_GRAPH_ALIGN_LEFT + IMAGE_GRAPH_ALIGN_TOP;
$this->_font = & $font;
$this->_setCoords($x, $y, $x, $y);
$this->setText($text);
}
示例2:
/**
* PlotType [Constructor]
* @param Dataset $dataset The data set (value containter) to plot
* @param string $title The title of the plot (used for legends, {@see Image_Graph_Legend})
*/
function &Image_Graph_Plot(& $dataset, $title = "")
{
parent::__construct();
if ($dataset) {
$this->_dataset = & $dataset;
if ($title) {
$this->_title = $title;
}
}
}
示例3: ImageCreateFromPNG
/**
* Logo [Constructor]
* @param string $filename The filename and path of the image to use for logo
*/
function &Image_Graph_Logo($fileName, $alignment = IMAGE_GRAPH_ALIGN_TOP_RIGHT)
{
parent::__construct();
if (file_exists($fileName)) {
if (strtolower(substr($fileName, -4)) == ".png") {
$this->_image = ImageCreateFromPNG($this->_fileName = $fileName);
} else {
$this->_image = ImageCreateFromJPEG($this->_fileName = $fileName);
}
} else {
$this->_image = false;
}
$this->_alignment = $alignment;
}
示例4:
/**
* Logo [Constructor]
*
* @param string $filename The filename and path of the image to use for logo
*/
function Image_Graph_Logo($filename, $alignment = IMAGE_GRAPH_ALIGN_TOP_RIGHT)
{
parent::__construct();
$this->_filename = $filename;
$this->_alignment = $alignment;
}
示例5:
/**
* Rectangle [Construcor]
*
* @param int $x The leftmost pixel of the box on the canvas
* @param int $y The topmost pixel of the box on the canvas
* @param int $width The width in pixels of the box on the canvas
* @param int $height The height in pixels of the box on the canvas
*/
function Image_Graph_Figure_Rectangle($x, $y, $width, $height)
{
parent::__construct();
$this->_setCoords($x, $y, $x + $width, $y + $height);
}
示例6: elseif
/**
* Image_Graph [Constructor].
*
* If passing the 3 parameters they are defined as follows:'
*
* Fx.:
*
* $Graph =& new Image_Graph(400, 300);
*
* or using the factory method:
*
* $Graph =& Image_Graph::factory('graph', array(400, 300));
*
* This causes a 'png' canvas to be created by default.
*
* Otherwise use a single parameter either as an associated array or passing
* the canvas along to the constructor:
*
* 1) Create a new canvas with the following parameters:
*
* 'canvas' - The canvas type, can be any of 'gd', 'jpg', 'png' or 'svg'
* (more to come) - if omitted the default is 'gd'
*
* 'width' - The width of the graph
*
* 'height' - The height of the graph
*
* An example of this usage:
*
* $Graph =& Image_Graph::factory('graph', array(array('width' => 400,
* 'height' => 300, 'canvas' => 'jpg')));
*
* NB! In thïs case remember the "double" array (see {@link Image_Graph::
* factory()})
*
* 2) Use the canvas specified, pass a valid Image_Canvas as
* parameter. Remember to pass by reference, i. e. &$canvas, fx.:
*
* $Graph =& new Image_Graph($Canvas);
*
* or using the factory method:
*
* $Graph =& Image_Graph::factory('graph', $Canvas));
*
* @param mixed $params The width of the graph, an indexed array
* describing a new canvas or a valid {@link Image_Canvas} object
* @param int $height The height of the graph in pixels
* @param bool $createTransparent Specifies whether the graph should be
* created with a transparent background (fx for PNG's - note: transparent
* PNG's is not supported by Internet Explorer!)
*/
function Image_Graph($params, $height = false, $createTransparent = false)
{
parent::__construct();
$this->setFont(Image_Graph::factory('Image_Graph_Font'));
if (defined('IMAGE_GRAPH_DEFAULT_CANVAS_TYPE')) {
$canvasType = IMAGE_GRAPH_DEFAULT_CANVAS_TYPE;
} else {
$canvasType = 'png';
// use GD as default, if nothing else is specified
}
if (is_array($params)) {
if (isset($params['canvas'])) {
$canvasType = $params['canvas'];
}
$width = 0;
$height = 0;
if (isset($params['width'])) {
$width = $params['width'];
}
if (isset($params['height'])) {
$height = $params['height'];
}
} elseif (is_a($params, 'Image_Canvas')) {
$this->_canvas =& $params;
$width = $this->_canvas->getWidth();
$height = $this->_canvas->getHeight();
} elseif (is_numeric($params)) {
$width = $params;
}
if ($this->_canvas == null) {
include_once 'Image/Canvas.php';
$this->_canvas =& Image_Canvas::factory($canvasType, array('width' => $width, 'height' => $height));
}
$this->_setCoords(0, 0, $width - 1, $height - 1);
}
示例7:
/**
* Ellipse [Constructor]
*
* @param int $x The center pixel of the ellipse on the canvas
* @param int $y The center pixel of the ellipse on the canvas
* @param int $radiusX The width in pixels of the box on the canvas
* @param int $radiusY The height in pixels of the box on the canvas
*/
function Image_Graph_Figure_Ellipse($x, $y, $radiusX, $radiusY)
{
parent::__construct();
$this->_setCoords($x - $radiusX, $y - $radiusY, $x + $radiusX, $y + $radiusY);
}
示例8:
/**
* Image_Graph_Axis [Constructor].
* Normally a manual creation should not be necessary, axis are created automatically
* by the {@see Image_Graph_Plotarea} constructor unless explicitly defined otherwise
* @param int $type The type (direction) of the Axis, use IMAGE_GRAPH_AXIS_X for an X-axis (default, may be omitted) and IMAGE_GRAPH_AXIS_Y for Y-axis)
*/
function &Image_Graph_Axis($type = IMAGE_GRAPH_AXIS_X)
{
parent::__construct();
$this->_type = $type;
}
示例9:
/**
* Image_Graph_Layout [Constructor]
* @access private
*/
function &_image_GraPHPite_Layout()
{
parent::__construct();
$this->_padding = 2;
}
示例10:
/**
* Rectangle [Construcor]
*
* @param int $x The leftmost pixel of the box on the canvas
* @param int $y The topmost pixel of the box on the canvas
* @param int $width The width in pixels of the box on the canvas
* @param int $height The height in pixels of the box on the canvas
*/
function __construct($x, $y, $width, $height)
{
parent::__construct();
$this->_setCoords($x, $y, $x + $width, $y + $height);
}
示例11: ImageCreateTrueColor
/**
* GraPHP [Constructor]
* @param int $width The width of the graph in pixels
* @param int $height The height of the graph in pixels
*/
function &Image_Graph($width, $height)
{
parent::__construct();
$this->_setCoords(0, 0, $width -1, $height -1);
if (isset($GLOBALS['_Image_Graph_gd2'])) {
$this->_canvas = ImageCreateTrueColor($width, $height);
ImageAlphaBlending($this->_canvas(), true);
} else {
$this->_canvas = ImageCreate($width, $height);
}
if (file_exists($filename = (dirname(__FILE__)."/Graph/named_colors.txt"))) {
$colorLines = file($filename);
while (list ($id, $colorLine) = each($colorLines)) {
list ($colorName, $colorRed, $colorGreen, $colorBlue) = explode("\t", trim($colorLine));
define("IMAGE_GRAPH_" . $colorName, ($colorRed << 16) + ($colorGreen << 8) + $colorBlue);
}
}
define("IMAGE_GRAPH_TRANSPARENT", 0xabe123);
$ID = ImageColorAllocate($this->_canvas, 0xab, 0xe1, 0x23);
ImageColorTransparent($this->_canvas, $ID);
$this->addFont($GLOBALS['_Image_Graph_font']);
$this->addFont($GLOBALS['_Image_Graph_vertical_font']);
ImageFilledRectangle($this->_canvas(), 0, 0, $width -1, $height -1, $this->_color(IMAGE_GRAPH_WHITE));
}
示例12:
/**
* Ellipse [Constructor]
*
* @param int $x The center pixel of the ellipse on the canvas
* @param int $y The center pixel of the ellipse on the canvas
* @param int $radiusX The width in pixels of the box on the canvas
* @param int $radiusY The height in pixels of the box on the canvas
*/
function __construct($x, $y, $radiusX, $radiusY)
{
parent::__construct();
$this->_setCoords($x - $radiusX, $y - $radiusY, $x + $radiusX, $y + $radiusY);
}