margin() public method

Creates a margin around the QrCode.
public margin ( integer $margin )
$margin integer The desired margin in pixels around the QrCode
コード例 #1
0
ファイル: Google2FA.php プロジェクト: mohamedsharaf/google2fa
 /**
  * Generates a QR code data url to display inline.
  *
  * @param $company
  * @param $holder
  * @param $secret
  * @return string
  */
 public function getQRCodeInline($company, $holder, $secret, $size = 100)
 {
     $qr = new BaconQrCodeGenerator(null, new Png());
     $url = $this->getQRCodeUrl($company, $holder, $secret);
     return 'data:image/png;base64,' . base64_encode($qr->margin(0)->size($size)->generate($url));
 }
コード例 #2
0
ファイル: _ide_helper.php プロジェクト: xiao-hu00/phphub
 /**
  * Creates a margin around the QrCode
  *
  * @param int $margin The desired margin in pixels around the QrCode
  * @return $this 
  * @static 
  */
 public static function margin($margin)
 {
     return \SimpleSoftwareIO\QrCode\BaconQrCodeGenerator::margin($margin);
 }