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


PHP image::Line方法代码示例

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


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

示例1: prepareRowAsPdf

 /**
  * Adds to the TCPDF instance, the data related to a row in the GIS dataset.
  *
  * @param string $spatial    GIS LINESTRING object
  * @param string $label      Label for the GIS LINESTRING object
  * @param string $line_color Color for the GIS LINESTRING object
  * @param array  $scale_data Array containing data related to scaling
  * @param image  $pdf        TCPDF instance
  *
  * @return the modified TCPDF instance
  */
 public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
 {
     // allocate colors
     $red = hexdec(substr($line_color, 1, 2));
     $green = hexdec(substr($line_color, 3, 2));
     $blue = hexdec(substr($line_color, 4, 2));
     $line = array('width' => 1.5, 'color' => array($red, $green, $blue));
     // Trim to remove leading 'LINESTRING(' and trailing ')'
     $linesrting = substr($spatial, 11, strlen($spatial) - 12);
     $points_arr = $this->extractPoints($linesrting, $scale_data);
     foreach ($points_arr as $point) {
         if (!isset($temp_point)) {
             $temp_point = $point;
         } else {
             // draw line section
             $pdf->Line($temp_point[0], $temp_point[1], $point[0], $point[1], $line);
             $temp_point = $point;
         }
     }
     // print label
     if (isset($label) && trim($label) != '') {
         $pdf->SetXY($points_arr[1][0], $points_arr[1][1]);
         $pdf->SetFontSize(5);
         $pdf->Cell(0, 0, trim($label));
     }
     return $pdf;
 }
开发者ID:Dikape,项目名称:course_work,代码行数:38,代码来源:pma_gis_linestring.php

示例2: prepareRowAsPdf

 /**
  * Adds to the TCPDF instance, the data related to a row in the GIS dataset.
  *
  * @param string $spatial    GIS MULTILINESTRING object
  * @param string $label      Label for the GIS MULTILINESTRING object
  * @param string $line_color Color for the GIS MULTILINESTRING object
  * @param array  $scale_data Array containing data related to scaling
  * @param image  $pdf        TCPDF instance
  *
  * @return the modified TCPDF instance
  */
 public function prepareRowAsPdf($spatial, $label, $line_color, $scale_data, $pdf)
 {
     // allocate colors
     $red = hexdec(substr($line_color, 1, 2));
     $green = hexdec(substr($line_color, 3, 2));
     $blue = hexdec(substr($line_color, 4, 2));
     $line = array('width' => 1.5, 'color' => array($red, $green, $blue));
     // Trim to remove leading 'MULTILINESTRING((' and trailing '))'
     $multilinestirng = substr($spatial, 17, strlen($spatial) - 19);
     // Seperate each linestring
     $linestirngs = explode("),(", $multilinestirng);
     $first_line = true;
     foreach ($linestirngs as $linestring) {
         $points_arr = $this->extractPoints($linestring, $scale_data);
         foreach ($points_arr as $point) {
             if (!isset($temp_point)) {
                 $temp_point = $point;
             } else {
                 // draw line section
                 $pdf->Line($temp_point[0], $temp_point[1], $point[0], $point[1], $line);
                 $temp_point = $point;
             }
         }
         unset($temp_point);
         // print label
         if (isset($label) && trim($label) != '' && $first_line) {
             $pdf->SetXY($points_arr[1][0], $points_arr[1][1]);
             $pdf->SetFontSize(5);
             $pdf->Cell(0, 0, trim($label));
         }
         $first_line = false;
     }
     return $pdf;
 }
开发者ID:AmberWish,项目名称:laba_web,代码行数:45,代码来源:pma_gis_multilinestring.php


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