SimpleSoftwareIO\QrCode\BaconQrCodeGenerator::merge PHP Method

merge() public method

Merges an image with the center of the QrCode.
public merge ( $filepath, $percentage = 0.2, $absolute = false )
$filepath string The filepath to an image
$percentage float The amount that the merged image should be placed over the qrcode.
$absolute boolean Whether to use an absolute filepath or not.
    public function merge($filepath, $percentage = 0.2, $absolute = false)
    {
        if (function_exists('base_path') && !$absolute) {
            $filepath = base_path() . $filepath;
        }
        $this->imageMerge = file_get_contents($filepath);
        $this->imagePercentage = $percentage;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Merges an image with the center of the QrCode
  *
  * @param $image string The filepath to an image
  * @return $this 
  * @static 
  */
 public static function merge($image, $percentage = '0.2')
 {
     return \SimpleSoftwareIO\QrCode\BaconQrCodeGenerator::merge($image, $percentage);
 }