<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                上代碼 # 第一版 ~~~ $miniapp_path= "https://card.oss.yongtoc.com/images/4b76e36ae5b4edc20f9ee7c7d79e10ea.jpg"; $picture = "https://card.oss.yongtoc.com/images/4b76e36ae5b4edc20f9ee7c7d79e10ea.jpg"; $dst_path = $picture; // 背景圖 $src_path = $miniapp_path;// 二維碼圖 //創建圖片的實例 $dst = imagecreatefromstring(file_get_contents($dst_path)); $src = imagecreatefromstring(file_get_contents($src_path)); // 把二維碼圖片的白色背景設為透明 imagecolortransparent($src, imagecolorallocate($src, 255, 255, 255)); list($src_w, $src_h) = getimagesize($src_path);//獲取二維碼圖的寬高 list($dst_w, $dst_h) = getimagesize($dst_path);//獲取背景圖的寬高 // var_dump(getimagesize($src_path)); // var_dump(getimagesize($dst_path));die; $dst_y = $dst_h-$src_h-4; $dst_x = $dst_w-$src_w-4; //將水印圖片復制到目標圖片上 imagecopymerge($dst, $src, $dst_x, $dst_y, 0, 0, $src_w, $src_h, 100); //生成圖片 header("Content-Type: image/png; charset=utf-8"); //第二個參數,需要保存圖片的話就傳路徑+圖片名字 imagepng($dst); //銷毀 imagedestroy($dst); imagedestroy($src); exit(); ~~~ # 第二版(推薦使用這個,已經完善,二維碼可以重置大小) ~~~ $miniapp_path= "https://card.oss.yongtoc.com/images/4b76e36ae5b4edc20f9ee7c7d79e10ea.jpg"; $picture = "https://card.oss.yongtoc.com/images/4b76e36ae5b4edc20f9ee7c7d79e10ea.jpg";//背景路徑 $dst_path = $picture; // 背景圖 $src_path = $miniapp_path;// 二維碼圖 //創建圖片的實例 返回值Resource id #數字 $dst = imagecreatefromstring(file_get_contents($dst_path)); $src = imagecreatefromstring(file_get_contents($src_path)); /** 把二維碼圖片大小給重置到合適大小 s*/ //獲取二維碼圖片的高寬信息 $src_w = imagesx($src); $src_h = imagesy($src); //創建一個空圖片,設置好高寬 $qr_code = imagecreatetruecolor(200, 200); //把現有的圖片,合拼到$qr_code的空圖片里面 imagecopyresized($qr_code, $src, 0, 0, 0, 0,200, 200, $src_w, $src_h); /** 把二維碼圖片大小給重置到合適大小 e*/ // 把二維碼圖片的白色背景設為透明 imagecolortransparent($qr_code, imagecolorallocate($qr_code, 255, 255, 255)); //這樣獲取是傳路徑獲取高寬 // list($dst_w, $dst_h) = getimagesize($dst_path);//獲取背景圖的寬高 //這樣獲取是傳圖片資源Resource id獲取高寬 $dst_w = imagesx($dst); $dst_h = imagesy($dst); //重新獲取最新改變后的二維碼圖片的高寬信息 $src_w = imagesx($qr_code); $src_h = imagesy($qr_code); //二維碼放在背景圖片上面的位置 $dst_y = $dst_h-$src_h-10; $dst_x = $dst_w-$src_w-10; //將二維碼圖片復制到目標背景圖片上 imagecopymerge($dst, $qr_code, $dst_x, $dst_y, 0, 0, $src_w, $src_h, 100); //生成圖片 header("Content-Type: image/png; charset=utf-8"); //第二個參數,需要保存圖片的話就傳路徑+圖片名字 imagepng($dst); //銷毀 imagedestroy($dst); imagedestroy($src); //如果要刪除文件就去掉注釋 //unlink($miniapp_path); exit(); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看