搞了两天,没有弄成,宣布失败,求高手帮忙!
Jun 13, 2016 am 11:28 AM
image
nbsp
private
this
搞了两天,没弄成,宣布失败,求高手帮忙!!
下面这个代码,是可以直接把图片处理为四个角都为园的。
但是现在产生的图片是没生成文件的,想改为处理的文件可以生成一个在指定目录。。
弄了两天,总是不行。。。求高手帮忙看看。。谢谢!
例如运行网址:http://www.xxx.com/pic.php?gopic=1234.jpg
pic.php代码如下:
<br><?php <br />class RoundedCorner { <br> private $_r; <br> private $_g; <br> private $_b; <br> private $_image_path; <br> private $_radius; <br> <br> function __construct($image_path, $radius, $r = 255, $g = 255, $b = 255) { <br> $this->_image_path = $image_path; <br> $this->_radius = $radius; <br> $this->_r = (int)$r; <br> $this->_g = (int)$g; <br> $this->_b = (int)$b; <br> } <br> <br> private function _get_lt_rounder_corner() { <br> $radius = $this->_radius; <br> $img = imagecreatetruecolor($radius, $radius); <br> $bgcolor = imagecolorallocate($img, $this->_r, $this->_g, $this->_b); <br> $fgcolor = imagecolorallocate($img, 0, 0, 0); <br> imagefill($img, 0, 0, $bgcolor); <br> imagefilledarc($img, $radius, $radius, $radius*2, $radius*2, 180, 270, $fgcolor, IMG_ARC_PIE); <br> imagecolortransparent($img, $fgcolor); <br> return $img; <br> } <br> <br> private function _load_source_image() { <br> $ext = substr($this->_image_path, strrpos($this->_image_path, '.')); <br> if (empty($ext)) { <br> return false; <div class="clear"> </div>
登入後複製
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱門文章
擊敗分裂小說需要多長時間?
3 週前
By DDD
倉庫:如何復興隊友
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
公眾號網頁更新緩存難題:如何避免版本更新後舊緩存影響用戶體驗?
3 週前
By 王林
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前
By 尊渡假赌尊渡假赌尊渡假赌

熱門文章
擊敗分裂小說需要多長時間?
3 週前
By DDD
倉庫:如何復興隊友
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前
By 尊渡假赌尊渡假赌尊渡假赌
公眾號網頁更新緩存難題:如何避免版本更新後舊緩存影響用戶體驗?
3 週前
By 王林
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前
By 尊渡假赌尊渡假赌尊渡假赌

熱門文章標籤

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

OOBELANGUAGE錯誤Windows 11 / 10修復中出現問題的問題
