本文整理匯總了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);