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


PHP BCGBarcode1D::getMaxSize方法代码示例

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


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

示例1: getMaxSize

 /**
  * Returns the maximal size of a barcode
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $array = str_split($this->text, 1);
     $textlength = (array_sum($array) + count($array)) * $this->scale;
     return array($p[0] + $textlength, $p[1]);
 }
开发者ID:viktoredz,项目名称:bpom-spkp,代码行数:12,代码来源:BCGothercode.barcode.php

示例2: getMaxSize

 /**
  * Returns the maximal size of a barcode.
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $textlength = 12 * strlen($this->text) * $this->scale;
     $startlength = 3 * $this->scale;
     $checksumlength = $this->checksum * 12 * $this->scale;
     $endlength = 4 * $this->scale;
     return array($p[0] + $startlength + $textlength + $checksumlength + $endlength, $p[1]);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:14,代码来源:BCGmsi.barcode.php

示例3: getMaxSize

 /**
  * Returns the maximal size of a barcode.
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $startlength = 3 * $this->scale;
     $centerlength = 5 * $this->scale;
     $textlength = 8 * 7 * $this->scale;
     $endlength = 3 * $this->scale;
     return array($p[0] + $startlength + $centerlength + $textlength + $endlength, $p[1]);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:14,代码来源:BCGean8.barcode.php

示例4: getMaxSize

 /**
  * Returns the maximal size of a barcode
  *
  * @return int
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $c = strlen($this->text);
     $startlength = 6 * $this->scale;
     $textlength = $c * 5 * 6 * $this->scale;
     $checksumlength = 5 * 6 * $this->scale;
     $endlength = 6 * $this->scale;
     // We remove the white on the right
     $removelength = -3 * $this->scale;
     return array($p[0] + $startlength + $textlength + $checksumlength + $endlength + $removelength, $p[1]);
 }
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:17,代码来源:BCGpostnet.barcode.php

示例5: getMaxSize

 /**
  * Returns the maximal size of a barcode.
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $textlength = 7 * strlen($this->text) * $this->scale;
     $startlength = 4 * $this->scale;
     $checksumlength = 0;
     if ($this->checksum === true) {
         $checksumlength = 7 * $this->scale;
     }
     $endlength = 4 * $this->scale;
     return array($p[0] + $startlength + $textlength + $checksumlength + $endlength, $p[1]);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:17,代码来源:BCGi25.barcode.php

示例6: getMaxSize

 /**
  * Returns the maximal size of a barcode.
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $c = strlen($this->text);
     $startlength = 8 * $this->scale;
     $textlength = $c * 14 * $this->scale;
     $checksumlength = 0;
     if ($c % 2 !== 0) {
         $checksumlength = 14 * $this->scale;
     }
     $endlength = 7 * $this->scale;
     return array($p[0] + $startlength + $textlength + $checksumlength + $endlength, $p[1]);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:18,代码来源:BCGs25.barcode.php

示例7: getMaxSize

 /**
  * Returns the maximal size of a barcode
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $w = 0;
     $c = strlen($this->text);
     for ($i = 0; $i < $c; $i++) {
         $index = $this->findIndex($this->text[$i]);
         if ($index !== false) {
             $w += 8;
             $w += substr_count($this->code[$index], '1');
         }
     }
     return array($p[0] + $w * $this->scale, $p[1]);
 }
开发者ID:lincome,项目名称:wechat-O2O-hyk,代码行数:19,代码来源:BCGcodabar.barcode.php

示例8: drawText

 /**
  * Overloaded method for drawing special label
  *
  * @param resource $im
  */
 protected function drawText($im)
 {
     if ($this->label !== BCGBarcode1D::AUTO_LABEL && $this->label !== '') {
         $pA = $this->getMaxSize();
         $pB = BCGBarcode1D::getMaxSize();
         $w = $pA[0] - $pB[0];
         if ($this->textfont instanceof BCGFont) {
             $textfont = clone $this->textfont;
             $textfont->setText($this->label);
             $xPosition = $w / 2 - $textfont->getWidth() / 2 + $this->offsetX * $this->scale;
             $yPosition = $this->thickness * $this->scale + $textfont->getHeight() - $textfont->getUnderBaseline() + BCGBarcode1D::SIZE_SPACING_FONT + $this->offsetY * $this->scale;
             $text_color = $this->colorFg->allocate($im);
             $textfont->draw($im, $text_color, $xPosition, $yPosition);
         } elseif ($this->textfont !== 0) {
             $xPosition = $w / 2 - strlen($this->label) * imagefontwidth($this->textfont) / 2 + $this->offsetX * $this->scale;
             $yPosition = $this->thickness * $this->scale + $this->offsetY * $this->scale + BCGBarcode1D::SIZE_SPACING_FONT;
             $text_color = $this->colorFg->allocate($im);
             imagestring($im, $this->textfont, $xPosition, $yPosition, $this->label, $text_color);
         }
     }
 }
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:26,代码来源:BCGothercode.barcode.php

示例9: getMaxSize

 /**
  * Returns the maximal size of a barcode.
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $w = 0;
     $c = strlen($this->text);
     for ($i = 0; $i < $c; $i++) {
         $index = $this->findIndex($this->text[$i]);
         if ($index !== false) {
             $w += 6;
             $w += substr_count($this->code[$index], '1');
         }
     }
     $startlength = 8 * $this->scale;
     $textlength = $w * $this->scale;
     // We take the max length possible for checksums (it is 7 or 8...)
     $checksumlength = 8 * $this->scale;
     if ($c >= 10) {
         $checksumlength += 8 * $this->scale;
     }
     $endlength = 7 * $this->scale;
     return array($p[0] + $startlength + $textlength + $checksumlength + $endlength, $p[1]);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:27,代码来源:BCGcode11.barcode.php

示例10: getMaxSize

 /**
  * Returns the maximal size of a barcode.
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $startlength = 3 * $this->scale;
     $centerlength = 5 * $this->scale;
     $textlength = 6 * 7 * $this->scale;
     $endlength = $this->scale;
     $lastcharlength = $this->getEndPosition() + 2;
     return array($p[0] + $startlength + $centerlength + $textlength + $endlength + $lastcharlength, $p[1]);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:15,代码来源:BCGupce.barcode.php

示例11: getMaxSize

 /**
  * Returns the maximal size of a barcode.
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $startlength = 9 * $this->scale;
     $textlength = 9 * count($this->data) * $this->scale;
     $checksumlength = 2 * 9 * $this->scale;
     $endlength = 9 * $this->scale + $this->scale;
     // + final bar
     return array($p[0] + $startlength + $textlength + $checksumlength + $endlength, $p[1]);
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:15,代码来源:BCGcode93.barcode.php

示例12: getMaxSize

 /**
  * Returns the maximal size of a barcode
  *
  * @return int[]
  */
 function getMaxSize()
 {
     $p = BCGBarcode1D::getMaxSize();
     $startlength = 3 * $this->scale;
     $centerlength = 5 * $this->scale;
     $textlength = 12 * 7 * $this->scale;
     $endlength = 3 * $this->scale;
     return array($p[0] + $startlength + $centerlength + $textlength + $endlength, $p[1]);
 }
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:14,代码来源:BCGean13.barcode.php

示例13: getMaxSize

 /**
  * Returns the maximal size of a barcode
  *
  * @return int[]
  */
 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     // Contains start + text + checksum + stop
     $textlength = count($this->data) * 11 * $this->scale;
     $endlength = 2 * $this->scale;
     // + final bar
     return array($p[0] + $textlength + $endlength, $p[1]);
 }
开发者ID:shojibflamon,项目名称:Bar-Code-example,代码行数:14,代码来源:BCGcode128.barcode.php

示例14: getMaxSize

 public function getMaxSize()
 {
     $p = parent::getMaxSize();
     $textlength = count($this->data) * 11 * $this->scale;
     $endlength = 2 * $this->scale;
     // + final bar
     return array($p[0] + $textlength + $endlength, $p[1]);
 }
开发者ID:huangs0928,项目名称:zzlangshi,代码行数:8,代码来源:code128.barcode.php

示例15: drawText

 /**
  * Overloaded method for drawing special label.
  *
  * @param resource $im
  */
 protected function drawText($im)
 {
     $label = $this->getLabel();
     if (!empty($label)) {
         $pA = $this->getMaxSize();
         $pB = BCGBarcode1D::getMaxSize();
         $w = $pA[0] - $pB[0];
         if ($this->textfont instanceof BCGFont) {
             $textfont = clone $this->textfont;
             $textfont->setText($label);
             $xPosition = $w / 2 - $textfont->getWidth() / 2 + $this->offsetX * $this->scale;
             $yPosition = $this->offsetY * $this->scale - BCGBarcode1D::SIZE_SPACING_FONT + 1;
             // +1 for anti-aliasing
             $textfont->draw($im, $this->colorFg->allocate($im), $xPosition, $yPosition);
         } elseif ($this->textfont !== 0) {
             $xPosition = $w / 2 - strlen($label) / 2 * imagefontwidth($this->textfont) + $this->offsetX * $this->scale;
             $yPosition = $this->offsetY * $this->scale - BCGBarcode1D::SIZE_SPACING_FONT - imagefontheight($this->textfont);
             imagestring($im, $this->textfont, $xPosition, $yPosition, $label, $this->colorFg->allocate($im));
         }
     }
 }
开发者ID:marsa1985,项目名称:kazabiz,代码行数:26,代码来源:BCGupcext5.barcode.php


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