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


PHP image::SetXY方法代碼示例

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


在下文中一共展示了image::SetXY方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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

示例3: prepareRowAsPdf

 /**
  * Adds to the TCPDF instance, the data related to a row in the GIS dataset.
  *
  * @param string $spatial     GIS POINT object
  * @param string $label       Label for the GIS POINT object
  * @param string $point_color Color for the GIS POINT 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, $point_color, $scale_data, $pdf)
 {
     // allocate colors
     $red = hexdec(substr($point_color, 1, 2));
     $green = hexdec(substr($point_color, 3, 2));
     $blue = hexdec(substr($point_color, 4, 2));
     $line = array('width' => 1.25, 'color' => array($red, $green, $blue));
     // Trim to remove leading 'POINT(' and trailing ')'
     $point = substr($spatial, 6, strlen($spatial) - 7);
     $points_arr = $this->extractPoints($point, $scale_data);
     // draw a small circle to mark the point
     if ($points_arr[0][0] != '' && $points_arr[0][1] != '') {
         $pdf->Circle($points_arr[0][0], $points_arr[0][1], 2, 0, 360, 'D', $line);
         // print label if applicable
         if (isset($label) && trim($label) != '') {
             $pdf->SetXY($points_arr[0][0], $points_arr[0][1]);
             $pdf->SetFontSize(5);
             $pdf->Cell(0, 0, trim($label));
         }
     }
     return $pdf;
 }
開發者ID:Dikape,項目名稱:course_work,代碼行數:33,代碼來源:pma_gis_point.php

示例4: prepareRowAsPdf

 /**
  * Adds to the TCPDF instance, the data related to a row in the GIS dataset.
  *
  * @param string $spatial    GIS MULTIPOLYGON object
  * @param string $label      Label for the GIS MULTIPOLYGON object
  * @param string $fill_color Color for the GIS MULTIPOLYGON 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, $fill_color, $scale_data, $pdf)
 {
     // allocate colors
     $red = hexdec(substr($fill_color, 1, 2));
     $green = hexdec(substr($fill_color, 3, 2));
     $blue = hexdec(substr($fill_color, 4, 2));
     $color = array($red, $green, $blue);
     // Trim to remove leading 'MULTIPOLYGON(((' and trailing ')))'
     $multipolygon = substr($spatial, 15, strlen($spatial) - 18);
     // Seperate each polygon
     $polygons = explode(")),((", $multipolygon);
     $first_poly = true;
     foreach ($polygons as $polygon) {
         // If the polygon doesnt have an inner polygon
         if (strpos($polygon, "),(") === false) {
             $points_arr = $this->extractPoints($polygon, $scale_data, true);
         } else {
             // Seperate outer and inner polygons
             $parts = explode("),(", $polygon);
             $outer = $parts[0];
             $inner = array_slice($parts, 1);
             $points_arr = $this->extractPoints($outer, $scale_data, true);
             foreach ($inner as $inner_poly) {
                 $points_arr = array_merge($points_arr, $this->extractPoints($inner_poly, $scale_data, true));
             }
         }
         // draw polygon
         $pdf->Polygon($points_arr, 'F*', array(), $color, true);
         // mark label point if applicable
         if (isset($label) && trim($label) != '' && $first_poly) {
             $label_point = array($points_arr[2], $points_arr[3]);
         }
         $first_poly = false;
     }
     // print label if applicable
     if (isset($label_point)) {
         $pdf->SetXY($label_point[0], $label_point[1]);
         $pdf->SetFontSize(5);
         $pdf->Cell(0, 0, trim($label));
     }
     return $pdf;
 }
開發者ID:AmberWish,項目名稱:laba_web,代碼行數:53,代碼來源:pma_gis_multipolygon.php


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