>  기사  >  백엔드 개발  >  搞了两天,没有弄成,宣布失败,求高手帮忙!

搞了两天,没有弄成,宣布失败,求高手帮忙!

WBOY
WBOY원래의
2016-06-13 12:43:42779검색

搞了两天,没弄成,宣布失败,求高手帮忙!!
下面这个代码,是可以直接把图片处理为四个角都为园的。
但是现在产生的图片是没生成文件的,想改为处理的文件可以生成一个在指定目录。。
弄了两天,总是不行。。。求高手帮忙看看。。谢谢!
例如运行网址: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으로 문의하세요.