当前位置: 首页>>代码示例>>PHP>>正文


PHP Image_Canvas::image方法代码示例

本文整理汇总了PHP中Image_Canvas::image方法的典型用法代码示例。如果您正苦于以下问题:PHP Image_Canvas::image方法的具体用法?PHP Image_Canvas::image怎么用?PHP Image_Canvas::image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Image_Canvas的用法示例。


在下文中一共展示了Image_Canvas::image方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: image

 /**
  * Overlay image
  *
  * Parameter array:
  * 'x': int X-point of overlayed image
  * 'y': int Y-point of overlayed image
  * 'filename': string The filename of the image to overlay
  * 'width': int [optional] The width of the overlayed image (resizing if possible)
  * 'height': int [optional] The height of the overlayed image (resizing if possible)
  * 'alignment': array [optional] Alignment
  */
 function image($params)
 {
     if (isset($this->_imageMap)) {
         $this->_imageMap->image($params);
     }
     parent::image($params);
 }
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:18,代码来源:WithMap.php

示例2: image

 /**
  * Overlay image
  *
  * Parameter array:
  * 'x': int X-point of overlayed image
  * 'y': int Y-point of overlayed image
  * 'filename': string The filename of the image to overlay
  * 'width': int [optional] The width of the overlayed image (resizing if possible)
  * 'height': int [optional] The height of the overlayed image (resizing if possible)
  * 'alignment': array [optional] Alignment
  */
 function image($params)
 {
     $x = $this->_getX($params['x']);
     $y = $this->_getY($params['y']);
     $filename = $params['filename'];
     list($width, $height, $type, $attr) = getimagesize($filename);
     $width = isset($params['width']) ? $params['width'] : $width;
     $height = isset($params['height']) ? $params['height'] : $height;
     $alignment = isset($params['alignment']) ? $params['alignment'] : false;
     $file = fopen($filename, 'rb');
     $filedata = fread($file, filesize($filename));
     fclose($file);
     $data = 'data:' . image_type_to_mime_type($type) . ';base64,' . base64_encode($filedata);
     $this->_addElement('<image xlink:href="' . $data . '" x="' . $x . '" y="' . $y . '"' . ($width ? ' width="' . $width . '"' : '') . ($height ? ' height="' . $height . '"' : '') . ' preserveAspectRatio="none"/>', $params);
     parent::image($params);
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:27,代码来源:SVG.php

示例3: image

 /**
  * Overlay image
  *
  * Parameter array:
  * 'x': int X-point of overlayed image
  * 'y': int Y-point of overlayed image
  * 'filename': string The filename of the image to overlay
  * 'width': int [optional] The width of the overlayed image (resizing if possible)
  * 'height': int [optional] The height of the overlayed image (resizing if possible)
  * 'alignment': array [optional] Alignment
  */
 function image($params)
 {
     $x = $this->_getX($params['x']);
     $y = $this->_getY($params['y']);
     $filename = $params['filename'];
     $width = isset($params['width']) ? $params['width'] : false;
     $height = isset($params['height']) ? $params['height'] : false;
     $alignment = isset($params['alignment']) ? $params['alignment'] : false;
     if (substr($filename, -4) == '.png') {
         $type = 'png';
     } elseif (substr($filename, -4) == '.jpg') {
         $type = 'jpeg';
     }
     $image = pdf_load_image($this->_pdf, $type, realpath($filename), '');
     $width_ = pdf_get_value($this->_pdf, 'imagewidth', $image);
     $height_ = pdf_get_value($this->_pdf, 'imageheight', $image);
     $outputWidth = $width !== false ? $width : $width_;
     $outputHeight = $height !== false ? $height : $height_;
     if (!is_array($alignment)) {
         $alignment = array('vertical' => 'top', 'horizontal' => 'left');
     }
     if (!isset($alignment['vertical'])) {
         $alignment['vertical'] = 'top';
     }
     if (!isset($alignment['horizontal'])) {
         $alignment['horizontal'] = 'left';
     }
     if ($alignment['horizontal'] == 'right') {
         $x -= $outputWidth;
     } elseif ($alignment['horizontal'] == 'center') {
         $x -= $outputWidth / 2;
     }
     if ($alignment['vertical'] == 'top') {
         $y += $outputHeight;
     } elseif ($alignment['vertical'] == 'center') {
         $y += $outputHeight / 2;
     }
     if ($width === false && $height === false) {
         $scale = 1;
     } else {
         $scale = max($height / $height_, $width / $width_);
     }
     pdf_place_image($this->_pdf, $image, $this->_getX($x), $this->_getY($y), $scale);
     pdf_close_image($this->_pdf, $image);
     parent::image($params);
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:57,代码来源:PDF.php

示例4: image

 /**
  * Overlay image
  *
  * Parameter array:
  * 'x'         : int X-point of overlayed image
  * 'y'         : int Y-point of overlayed image
  * 'filename'  : string The filename of the image to overlay
  * 'width'     : int [optional] The width of the overlayed image (resizing if possible)
  * 'height'    : int [optional] The height of the overlayed image (resizing if possible)
  * 'alignment' : array [optional] Alignment
  * 'url'       : string [optional] Target URL
  *
  * @param array $params Parameter array
  *
  * @return void
  */
 function image($params)
 {
     parent::image($params);
 }
开发者ID:roojs,项目名称:pear,代码行数:20,代码来源:SWF.php


注:本文中的Image_Canvas::image方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。