本文整理汇总了PHP中Image_Canvas::Image_Canvas方法的典型用法代码示例。如果您正苦于以下问题:PHP Image_Canvas::Image_Canvas方法的具体用法?PHP Image_Canvas::Image_Canvas怎么用?PHP Image_Canvas::Image_Canvas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image_Canvas
的用法示例。
在下文中一共展示了Image_Canvas::Image_Canvas方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Create the canvas.
*
* Parameters available:
*
* 'width' The width of the graph on the canvas
*
* 'height' The height of the graph on the canvas
*
* 'left' The left offset of the graph on the canvas
*
* 'top' The top offset of the graph on the canvas
*
* 'usemap' Initialize an image map
*
* @param array $params Parameter array
* @abstract
*/
function Image_Canvas_WithMap($params)
{
parent::Image_Canvas($params);
if (isset($params['usemap']) && $params['usemap'] === true) {
$this->_imageMap =& Image_Canvas::factory('ImageMap', array('left' => $this->_left, 'top' => $this->_top, 'width' => $this->_width, 'height' => $this->_height));
}
}
示例2: isset
/**
* Creates the SWF movie object
*
* Parameters available:
*
* 'width' The width of the graph
* 'height' The height of the graph
* 'version' The flash version, supports up to version 6
* 'background' An array with the background color, e.g.
* array('red' => 255,
* 'green' => 0,
* 'blue' => 0)
* Either integers between 0 and 255 or hexadecimals
* between 0x00 and 0xFF
*
* @param array $params Parameter array
*
* @return Image_Canvas_SWF
*/
function Image_Canvas_SWF($params)
{
parent::Image_Canvas($params);
$this->_reset();
$version = isset($params['version']) && $params['version'] <= 6 ? $params['version'] : $this->_version;
$this->_canvas = new SWFMovie($version);
$this->_canvas->setDimension($this->_width, $this->_height);
if (isset($params['background'])) {
$this->setBackground($params['background']);
}
}
示例3: switch
/**
* Create the PDF canvas.
*
* Parameters available:
*
* 'page' Specify the page/paper format for the graph's page, available
* formats are: A0, A1, A2, A3, A4, A5, A6, B5, letter, legal, ledger,
* 11x17, cd_front, inlay, inlay_nosides
*
* 'align' Alignment of the graph on the page, available options are:
* topleft, topcenter, topright, leftcenter, center, rightcenter,
* leftbottom, centerbottom, rightbottom
*
* 'orientation' Specifies the paper orientation, default is 'portrait' and
* 'landscape' is also supported.
*
* 'creator' The creator tag of the PDF/graph
*
* 'author' The author tag of the PDF/graph
*
* 'title' The title tag of the PDF/graph
*
* 'width' The width of the graph on the page
*
* 'height' The height of the graph on the page
*
* 'left' The left offset of the graph on the page
*
* 'top' The top offset of the graph on the page
*
* 'filename' The PDF file to open/add page to, using 'filename' requires
* the commercial version of PDFlib (http://www.pdflib.com/), this has for
* obvious ($ 450) reasons not been tested
*
* 'pdf' An existing PDFlib PDF document to add the page to
*
* 'add_page' (true/false) Used together with 'pdf', to specify whether the
* canvas should add a new graph page (true) or create the graph on the
* current page (false), default is 'true'
*
* The 'page' and 'width' & 'height' can be mutually omitted, if 'page' is
* omitted the page is created using dimensions of width x height, and if
* width and height are omitted the page dimensions are used for the graph.
*
* If 'pdf' is specified, 'filename', 'creator', 'author' and 'title' has no
* effect.
*
* 'left' and 'top' are overridden by 'align'
*
* It is required either to specify 'width' & 'height' or 'page'.
*
* The PDF format/PDFlib has some limitations on the capabilities, which
* means some functionality available using other canvass (fx. alpha
* blending and gradient fills) are not supported with PDF (see Canvas.txt
* in the docs/ folder for further details)
*
* @param array $param Parameter array
*/
function Image_Canvas_PDF($param)
{
if (isset($param['page'])) {
switch (strtoupper($param['page'])) {
case 'A0':
$this->_pageWidth = 2380;
$this->_pageHeight = 3368;
break;
case 'A1':
$this->_pageWidth = 1684;
$this->_pageHeight = 2380;
break;
case 'A2':
$this->_pageWidth = 1190;
$this->_pageHeight = 1684;
break;
case 'A3':
$this->_pageWidth = 842;
$this->_pageHeight = 1190;
break;
case 'A4':
$this->_pageWidth = 595;
$this->_pageHeight = 842;
break;
case 'A5':
$this->_pageWidth = 421;
$this->_pageHeight = 595;
break;
case 'A6':
$this->_pageWidth = 297;
$this->_pageHeight = 421;
break;
case 'B5':
$this->_pageWidth = 501;
$this->_pageHeight = 709;
break;
case 'LETTER':
$this->_pageWidth = 612;
$this->_pageHeight = 792;
break;
case 'LEGAL':
$this->_pageWidth = 612;
//.........这里部分代码省略.........
示例4:
/**
* Create the SVG canvas.
*
* Parameters available:
*
* 'width' The width of the graph
*
* 'height' The height of the graph
*
* 'encoding' The encoding of the SVG document
*
* @param array $param Parameter array
*/
function Image_Canvas_SVG($params)
{
parent::Image_Canvas($params);
$this->_reset();
if (isset($params['encoding'])) {
$this->_encoding = $params['encoding'];
}
}
示例5:
/**
* Create the SVG canvas.
*
* Parameters available:
*
* 'width' The width of the graph
*
* 'height' The height of the graph
*
* @param array $param Parameter array
*/
function Image_Canvas_SVG($param)
{
parent::Image_Canvas($param);
$this->_reset();
}