mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-09-10 09:46:26 +00:00
:octocat: make $background local
This commit is contained in:
+5
-11
@@ -29,7 +29,7 @@ class QRImage extends QROutputAbstract{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $defaultMode = QRCode::OUTPUT_IMAGE_PNG;
|
||||
protected $defaultMode = QRCode::OUTPUT_IMAGE_PNG;
|
||||
|
||||
/**
|
||||
* @see imagecreatetruecolor()
|
||||
@@ -37,12 +37,6 @@ class QRImage extends QROutputAbstract{
|
||||
*/
|
||||
protected $image;
|
||||
|
||||
/**
|
||||
* @see imagecolorallocate()
|
||||
* @var int
|
||||
*/
|
||||
protected $background;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -70,14 +64,14 @@ class QRImage extends QROutputAbstract{
|
||||
* @return string
|
||||
*/
|
||||
public function dump(string $file = null):string{
|
||||
$this->image = \imagecreatetruecolor($this->length, $this->length);
|
||||
$this->background = \imagecolorallocate($this->image, ...$this->options->imageTransparencyBG);
|
||||
$this->image = \imagecreatetruecolor($this->length, $this->length);
|
||||
$background = \imagecolorallocate($this->image, ...$this->options->imageTransparencyBG);
|
||||
|
||||
if((bool)$this->options->imageTransparent && \in_array($this->options->outputType, $this::TRANSPARENCY_TYPES, true)){
|
||||
\imagecolortransparent($this->image, $this->background);
|
||||
\imagecolortransparent($this->image, $background);
|
||||
}
|
||||
|
||||
\imagefilledrectangle($this->image, 0, 0, $this->length, $this->length, $this->background);
|
||||
\imagefilledrectangle($this->image, 0, 0, $this->length, $this->length, $background);
|
||||
|
||||
foreach($this->matrix->matrix() as $y => $row){
|
||||
foreach($row as $x => $M_TYPE){
|
||||
|
||||
Reference in New Issue
Block a user