本文整理汇总了PHP中BCGBarcode1D::getDimension方法的典型用法代码示例。如果您正苦于以下问题:PHP BCGBarcode1D::getDimension方法的具体用法?PHP BCGBarcode1D::getDimension怎么用?PHP BCGBarcode1D::getDimension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BCGBarcode1D
的用法示例。
在下文中一共展示了BCGBarcode1D::getDimension方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$array = str_split($this->text, 1);
$textlength = array_sum($array) + count($array);
$w += $textlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例2: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$startlength = 4;
$textlength = 5 * 7;
$intercharlength = 2 * 4;
$w += $startlength + $textlength + $intercharlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例3: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$startlength = 3;
$centerlength = 5;
$textlength = 12 * 7;
$endlength = 3;
$w += $startlength + $centerlength + $textlength + $endlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例4: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$textlength = 12 * strlen($this->text);
$startlength = 3;
$checksumlength = $this->checksum * 12;
$endlength = 4;
$w += $startlength + $textlength + $checksumlength + $endlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例5: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$textlength = 13 * strlen($this->text);
$startlength = 13;
$checksumlength = 0;
if ($this->checksum === true) {
$checksumlength = 13;
}
$endlength = 13;
$w += $startlength + $textlength + $checksumlength + $endlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例6: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$c = strlen($this->text);
$startlength = 6;
$textlength = $c * 5 * 6;
$checksumlength = 5 * 6;
$endlength = 6;
// We remove the white on the right
$removelength = -3;
$w += $startlength + $textlength + $checksumlength + $endlength + $removelength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例7: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$c = strlen($this->text);
$startlength = 8;
$textlength = $c * 14;
$checksumlength = 0;
if ($c % 2 !== 0) {
$checksumlength = 14;
}
$endlength = 7;
$w += $startlength + $textlength + $checksumlength + $endlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例8: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$textLength = 0;
$c = strlen($this->text);
for ($i = 0; $i < $c; $i++) {
$index = $this->findIndex($this->text[$i]);
if ($index !== false) {
$textLength += 8;
$textLength += substr_count($this->code[$index], '1');
}
}
$w += $textLength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例9: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$startlength = 8;
$textlength = 0;
$c = strlen($this->text);
for ($i = 0; $i < $c; $i++) {
$textlength += $this->getIndexLength($this->findIndex($this->text[$i]));
}
$checksumlength = 0;
$this->calculateChecksum();
$c = count($this->checksumValue);
for ($i = 0; $i < $c; $i++) {
$checksumlength += $this->getIndexLength($this->checksumValue[$i]);
}
$endlength = 7;
$w += $startlength + $textlength + $checksumlength + $endlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例10: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$textlength = 0;
$c = strlen($this->text);
for ($i = 0; $i < $c; $i++) {
$index = $this->findIndex($this->text[$i]);
if ($index !== false) {
$textlength += 6;
$textlength += substr_count($this->code[$index], '1');
}
}
$startlength = 8;
// We take the max length possible for checksums (it is 7 or 8...)
$checksumlength = 8;
if ($c >= 10) {
$checksumlength += 8;
}
$endlength = 7 * $this->scale;
$w += $startlength + $textlength + $checksumlength + $endlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例11: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$w += 65 * 3;
$h += $this->thickness;
// We remove the white on the right
$w -= 1.56;
if ($this->quietZone) {
$w += 18;
$h += 4;
}
return parent::getDimension($w, $h);
}
示例12: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
// Contains start + text + checksum + stop
$textlength = count($this->data) * 11;
$endlength = 2;
// + final bar
$w += $textlength + $endlength;
$h += $this->thickness;
return parent::getDimension($w, $h);
}
示例13: getDimension
/**
* Returns the maximal size of a barcode.
*
* @param int $w
* @param int $h
* @return int[]
*/
public function getDimension($w, $h)
{
$textlength = 13 * count($this->data);
$startlength = 13;
$checksumlength = 0;
if ($this->checksum === true) {
$checksumlength = 13;
}
$endlength = 13;
$w += $startlength + $textlength + $checksumlength + $endlength;
$h += $this->thickness;
return BCGBarcode1D::getDimension($w, $h);
}
示例14: draw
* @param resource $im
*/
public function draw($im)
{
// Starting *
$this->drawChar($im, $this->code[$this->starting], true);
$c = count($this->data);
for ($i = 0; $i < $c; $i++) {
$this->drawChar($im, $this->data[$i], true);
}
// Checksum
$c = count($this->checksumValue);
for ($i = 0; $i < $c; $i++) {
$this->drawChar($im, $this->code[$this->checksumValue[$i]], true);
}
// Ending *
$this->drawChar($im, $this->code[$this->ending], true);