日期:2014-05-17  浏览次数:20420 次

搞了两天,没弄成,宣布失败,求高手帮忙!!
下面这个代码,是可以直接把图片处理为四个角都为园的。
但是现在产生的图片是没生成文件的,想改为处理的文件可以生成一个在指定目录。。
弄了两天,总是不行。。。求高手帮忙看看。。谢谢!
例如运行网址:http://www.xxx.com/pic.php?gopic=1234.jpg

pic.php代码如下:

<?php  
class RoundedCorner {  
    private $_r;  
    private $_g;  
    private $_b;  
    private $_image_path;  
    private $_radius;  
      
   function __construct($image_path, $radius, $r = 255, $g = 255, $b = 255) {   
        $this->_image_path = $image_path;  
        $this->_radius = $radius;  
        $this->_r = (int)$r;  
        $this->_g = (int)$g;  
        $this->_b = (int)$b;  
    }  
      
    private function _get_lt_rounder_corner() {  
        $radius = $this->_radius;  
        $img = imagecreatetruecolor($radius, $radius);  
        $bgcolor = imagecolorallocate($img, $this->_r, $this->_g, $this->_b);  
        $fgcolor = imagecolorallocate($img, 0, 0, 0);  
        imagefill($img, 0, 0, $bgcolor);  
        imagefilledarc($img, $radius, $radius, $radius*2, $radius*2, 180, 270, $fgcolor, IMG_ARC_PIE);  
        imagecolortransparent($img, $fgcolor);  
        return $img;  
    }  
      
    private function _load_source_image() {  
        $ext = substr($this->_image_path, strrpos($this->_image_path, '.'));  
        if (empty($ext)) {  
            return false;