zoukankan      html  css  js  c++  java
  • php 生成二维码 代码示例

    logo   是正方形  或者  圆形的   居多     
     
    <?php
    include ('phpqrcode.php');
    $value = 'http://www.codesc.net';//二维码数据
    $errorCorrectionLevel = 'L';//纠错级别:L、M、Q、H
    $matrixPointSize = 10;//二维码点的大小:1到10
    QRcode::png ( $value, 'ewm.png', $errorCorrectionLevel, $matrixPointSize, 2 );//不带Logo二维码的文件名
    echo "二维码已生成" . "<br />";
    $logo = 'emwlogo.gif';//需要显示在二维码中的Logo图像
    $QR = 'ewm.png';
    if ($logo !== FALSE) {
        $QR = imagecreatefromstring ( file_get_contents ( $QR ) );
        $logo = imagecreatefromstring ( file_get_contents ( $logo ) );
        $QR_width = imagesx ( $QR );
        $QR_height = imagesy ( $QR );
        $logo_width = imagesx ( $logo );
        $logo_height = imagesy ( $logo );
        $logo_qr_width = $QR_width / 5; //logo  在图片中的大小
        $scale = $logo_width / $logo_qr_width;
        $logo_qr_height = $logo_height / $scale;
        $from_width = ($QR_width - $logo_qr_width) / 2;
        imagecopyresampled ( $QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height );
    }
    imagepng ( $QR, 'ewmlogo.png' );//带Logo二维码的文件名
    ?>
  • 相关阅读:
    poj 2773 利用欧拉函数求互质数
    poj3358:欧拉定理
    poj:2992 因子数量
    poj3696:同余方程,欧拉定理
    USACO5.4-Character Recognition
    hdu5017:补题系列之西安网络赛1011
    hdu5014:number sequence对称思想
    欧拉函数,欧拉定理例题整理
    POJ 3463 Sightseeing (次短路)
    POJ
  • 原文地址:https://www.cnblogs.com/lijiageng/p/5749390.html
Copyright © 2011-2022 走看看