<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國際加速解決方案。 廣告
                ~~~ /** * 圖片增加圖片或文字水印 * * @param int $position 位置1~9分別代表了左上角到右下角 依次類推 */ function bornshareqrode( $bannerimg, $qrodeimg, $position, $uid = '', $width = '200', $heigth = '200' ) { $arr = array(); $arr = positionImg($position, $bannerimg, $width, $heigth); if ($bannerimg) { //生成中間帶logo的二維碼 //這是合成后的圖片保存的路徑 $upload_dir = "/public/upload/comp_pic/"; if (is_file($bannerimg)) { //創建畫布 $logo = imagecreatefromstring(file_get_contents($bannerimg)); $head_img1 = imagecreatefromstring(file_get_contents($qrodeimg)); //將$qrodeimg插入到$bannerimg里 imagecopyresampled($logo, $head_img1, $arr[0], $arr[1], 0, 0, $width, $heigth, imagesx($head_img1), imagesy($head_img1)); $imgName = 'u_'.$uid.'_'.time().'.png'; //生成圖片 imagepng($logo, ROOT_PATH.$upload_dir.$imgName); //生成圖片名字 $twocode = $upload_dir.$imgName; } return $twocode;//返回結果圖片url } else { return false; } } function positionImg($position, $imgPath, $width, $height) { $arr = array(); list($source_w, $source_h) = getimagesize($imgPath); $source_w = $source_w * 0.97; $source_h = $source_h * 0.98; switch ($position) { case 1: $wx = 5; $wy = 5; break; case 2: $wx = ($source_w - $width) / 2; $wy = 0; break; case 3: $wx = $source_w - $width; $wy = 0; break; case 4: $wx = 0; $wy = ($source_h - $height) / 2; break; case 5: $wx = ($source_w - $width) / 2; $wy = ($source_h - $height) / 2; break; case 6: $wx = $source_w - $width; $wy = ($source_h - $height) / 2; break; case 7: $wx = 0; $wy = $source_h - $height; break; case 8: $wx = ($source_w - $width) / 2; $wy = $source_h - $height; break; case 9: $wx = $source_w - $width; $wy = $source_h - $height; break; case 0: $wx = rand(0, ($source_w - $width)); $wy = rand(0, ($source_h - $height)); break; default: $wx = rand(0, ($source_w - $width)); $wy = rand(0, ($source_h - $height)); break; } $arr[] = (int)$wx; $arr[] = (int)$wy; dump($arr); return $arr; } ~~~ 使用方法: ~~~ public function test() { $bannerimg = ROOT_PATH.'/public/upload/comp_pic/img_1.png'; $qrodeimg = ROOT_PATH.'/public/upload/comp_pic/qr_1.png'; $uid = 11; $imgShare = bornshareqrode($bannerimg, $qrodeimg, 9, $uid, 90, 90); halt($imgShare); } ~~~
                  <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>

                              哎呀哎呀视频在线观看