| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\librarys\Picqer\Barcode;
- class BarcodeBar
- {
- protected $width;
- protected $height;
- protected $positionVertical;
- protected $type;
- const TYPE_BAR = 1;
- const TYPE_SPACING = 0;
- public function __construct(int $width, int $height, bool $drawBar = true, int $positionVertical = 0)
- {
- $this->width = $width;
- $this->height = $height;
- $this->positionVertical = $positionVertical;
- $this->type = $drawBar ? self::TYPE_BAR : self::TYPE_SPACING;
- }
- public function getWidth(): int
- {
- return $this->width;
- }
- public function getHeight(): int
- {
- return $this->height;
- }
- public function getPositionVertical(): int
- {
- return $this->positionVertical;
- }
- public function isBar(): bool
- {
- return $this->type === self::TYPE_BAR;
- }
- }
|