• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            xiaoguozi's Blog
            Pay it forword - 我并不覺的自豪,我所嘗試的事情都失敗了······習(xí)慣原本生活的人不容易改變,就算現(xiàn)狀很糟,他們也很難改變,在過程中,他們還是放棄了······他們一放棄,大家就都是輸家······讓愛傳出去,很困難,也無法預(yù)料,人們需要更細(xì)心的觀察別人,要隨時(shí)注意才能保護(hù)別人,因?yàn)樗麄兾幢刂雷约阂裁础ぁぁぁぁ?/span>
            /*

            以下為圖片處理類

            */ 
            <?php
            /*
             圖片處理函數(shù)功能:縮放、剪切、相框、水印、銳化、旋轉(zhuǎn)、翻轉(zhuǎn)、透明度、反色
             處理并保存歷史記錄的思路:當(dāng)有圖片有改動(dòng)時(shí)自動(dòng)生成一張新圖片,命名方式可以考慮在原圖片的基礎(chǔ)上加上步驟,例如:圖片名稱+__第幾步

             
            */
            class picture {
                
            var $PICTURE_URL;
                
            //要處理的圖片
                var $DEST_URL = "temp__01.jpg";
                
            //生成目標(biāo)圖片位置
                var $PICTURE_CREATE;
                
            //要?jiǎng)?chuàng)建的圖片
                var $TURE_COLOR;
                
            //新建一個(gè)真彩圖象

                
            var $PICTURE_WIDTH;
                
            //原圖片寬度
                var $PICTURE_HEIGHT;
                
            //原圖片高度

                
            /*
                 水印的類型,默認(rèn)的為水印文字
                 
            */
                
            var $MARK_TYPE = 1;
                
            var $WORD;
                
            //經(jīng)過UTF-8后的文字
                var $WORD_X;
                
            //文字橫坐標(biāo)
                var $WORD_Y;
                
            //文字縱坐標(biāo)
                var $FONT_TYPE;
                
            //字體類型
                var $FONT_SIZE = "12";
                
            //字體大小
                var $FONT_WORD;
                
            //文字
                var $ANGLE = 0;
                
            //文字的角度,默認(rèn)為0
                var $FONT_COLOR = "#ffffff";
                
            //文字顏色
                var $FONT_PATH = "22.ttf";
                
            //字體庫(kù),默認(rèn)為宋體

                
            var $FORCE_URL;
                
            //水印圖片
                var $FORCE_X = 0;
                
            //水印橫坐標(biāo)
                var $FORCE_Y = 0;
                
            //水印縱坐標(biāo)
                var $FORCE_START_X = 0;
                
            //切起水印的圖片橫坐標(biāo)
                var $FORCE_START_Y = 0;
                
            //切起水印的圖片縱坐標(biāo)

                
            var $PICTURE_TYPE;
                
            //圖片類型
                var $PICTURE_MIME;
                
            //輸出的頭部

                
            /*
                 縮放比例為1的話就按縮放高度和寬度縮放
                 
            */
                
            var $ZOOM = 1;
                
            //縮放類型
                var $ZOOM_MULTIPLE;
                
            //縮放比例
                var $ZOOM_WIDTH;
                
            //縮放寬度
                var $ZOOM_HEIGHT;
                
            //縮放高度

                
            /*
                 裁切,按比例和固定長(zhǎng)度、寬度
                 
            */
                
            var $CUT_TYPE = 1;
                
            //裁切類型
                var $CUT_X = 0;
                
            //裁切的橫坐標(biāo)
                var $CUT_Y = 0;
                
            //裁切的縱坐標(biāo)
                var $CUT_WIDTH = 100;
                
            //裁切的寬度
                var $CUT_HEIGHT = 100;
                
            //裁切的高度

                
            /*
                 銳化
                 
            */
                
            var $SHARP = "5.0";
                
            //銳化程度

                
            /*
                 透明度處理
                 
            */
                
            var $ALPHA = '100';
                
            //透明度在0-127之間
                var $ALPHA_X = "90";
                
            var $ALPHA_Y = "50";

                
            /*
                 任意角度旋轉(zhuǎn)
                 
            */
                
            var $CIRCUMROTATE = "90.0";
                
            //注意,必須為浮點(diǎn)數(shù)

                
            /*
                 出錯(cuò)信息
                 
            */
                
            var $ERROR = array('unalviable' => '沒有找到相關(guān)圖片!');

                
            /*
                 構(gòu)造函數(shù):函數(shù)初始化
                 
            */
                
            function __construct($PICTURE_URL) {

                    
            $this -> get_info($PICTURE_URL);

                }

                
            function get_info($PICTURE_URL) {
                    
            /*
                     處理原圖片的信息,先檢測(cè)圖片是否存在,不存在則給出相應(yīng)的信息
                     
            */
                    @
            $SIZE = getimagesize($PICTURE_URL);
                    
            if (!$SIZE) {
                        
            exit($this -> ERROR['unalviable']);
                    }

                    
            //得到原圖片的信息類型、寬度、高度
                    $this -> PICTURE_MIME = $SIZE['mime'];
                    
            $this -> PICTURE_WIDTH = $SIZE[0];
                    
            $this -> PICTURE_HEIGHT = $SIZE[1];

                    
            //Returns a array with 4 elements.
                    //The 0 index is the width of the image in pixels.
                    //The 1 index is the height of the image in pixels.
                    //The 2 index is a flag for the image type:

                    //1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(orden de bytes intel), 8 = TIFF(orden de bytes motorola), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM.

                    //The 3 index contains ' height="yyy" width="xxx"

                    //創(chuàng)建圖片

                    switch($SIZE[2]) {
                        
            case 1 :
                            
            $this -> PICTURE_CREATE = imagecreatefromgif($PICTURE_URL);
                            
            $this -> PICTURE_TYPE = "imagegif";
                            
            $this -> PICTURE_EXT = "gif";
                            
            break;
                        
            case 2 :
                            
            $this -> PICTURE_CREATE = imagecreatefromjpeg($PICTURE_URL);
                            
            $this -> PICTURE_TYPE = "imagejpeg";
                            
            $this -> PICTURE_EXT = "jpg";
                            
            break;
                        
            case 3 :
                            
            $this -> PICTURE_CREATE = imagecreatefrompng($PICTURE_URL);
                            
            $this -> PICTURE_TYPE = "imagepng";
                            
            $this -> PICTURE_EXT = "png";
                            
            break;
                        
            default :
                        
            //imagecreatefrom
                            break;
                    }

                    
            /*
                     文字顏色轉(zhuǎn)換16進(jìn)制轉(zhuǎn)換成10進(jìn)制
                     
            */
                    
            preg_match_all("/([0-f]){2,2}/i", $this -> FONT_COLOR, $MATCHES);
                    
            if (count($MATCHES== 3) {
                        
            $this -> RED = hexdec($MATCHES[0][0]);
                        
            $this -> GREEN = hexdec($MATCHES[0][1]);
                        
            $this -> BLUE = hexdec($MATCHES[0][2]);
                    }
                }

                
            #end of __construct

                
            /*
                 將16進(jìn)制的顏色轉(zhuǎn)換成10進(jìn)制的(R,G,B)
                 
            */
                
            function hex2dec() {
                    
            preg_match_all("/([0-f]{2,2})/i", $this -> FONT_COLOR, $MATCHES);
                    
            if (count($MATCHES[0]) == 3) {
                        
            $this -> RED = hexdec($MATCHES[0][0]);
                        
            $this -> GREEN = hexdec($MATCHES[0][1]);
                        
            $this -> BLUE = hexdec($MATCHES[0][2]);
                    } 
            else {
                        
            exit('錯(cuò)誤的顏色格式');
                    }
                }

                
            //縮放類型
                function zoom_type($ZOOM_TYPE) {
                    
            $this -> ZOOM = $ZOOM_TYPE;
                }

                
            //對(duì)圖片進(jìn)行縮放,如果不指定高度和寬度就進(jìn)行縮放
                function zoom() {
                    
            //縮放的大小
                    if ($this -> ZOOM == 0) {
                        
            $this -> ZOOM_WIDTH = $this -> PICTURE_WIDTH * $this -> ZOOM_MULTIPLE;
                        
            $this -> ZOOM_HEIGHT = $this -> PICTURE_HEIGHT * $this -> ZOOM_MULTIPLE;
                    }
                    
            //新建一個(gè)真彩圖象
                    $this -> TRUE_COLOR = imagecreatetruecolor($this -> ZOOM_WIDTH, $this -> ZOOM_HEIGHT);
                    
            $WHITE = imagecolorallocate($this -> TRUE_COLOR, 255, 255, 255);
                    imagefilledrectangle(
            $this -> TRUE_COLOR, 0, 0, $this -> ZOOM_WIDTH, $this -> ZOOM_HEIGHT, $WHITE);
                    imagecopyresized(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE, 0, 0, 0, 0, $this -> ZOOM_WIDTH, $this -> ZOOM_HEIGHT, $this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                }

                
            #end of zoom
                //裁切圖片,按坐標(biāo)或自動(dòng)

                function cut($zoom = 0) {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> CUT_WIDTH, $this -> CUT_WIDTH);
                    
            if (!$zoom) {
                        imagecopy(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE, 0, 0, $this -> CUT_X, $this -> CUT_Y, $this -> CUT_WIDTH, $this -> CUT_HEIGHT);
                    } 
            else {
                        
            $w = $this -> PICTURE_WIDTH;
                        
            $h = $this -> PICTURE_HEIGHT;
                        
            if (min($w, $h, $this -> CUT_WIDTH, $this -> CUT_HEIGHT) == 0)
                            
            exit('裁剪尺寸為零,或者獲取圖片尺寸');
                        
            $bl = $this -> CUT_WIDTH / $this -> CUT_HEIGHT;
                        
            $bl1 = $w / $h;
                        
            if ($bl > $bl1) {
                            
            $h = floor($w * $bl);
                        } 
            elseif ($bl < $bl1) {
                            
            $w = floor($h / $bl);
                        }
                        imagecopyresampled(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE, 0, 0, $this -> CUT_X, $this -> CUT_Y, $this -> CUT_WIDTH, $this -> CUT_HEIGHT, $w, $h);
                    }
                }

                
            #end of cut
                /*
                 在圖片上放文字或圖片
                 水印文字
                 
            */
                
            function _mark_text() {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    
            //$this->WORD=mb_convert_encoding($this->FONT_WORD,'utf-8','gb2312');
                    $this -> WORD = iconv('gb2312', 'utf-8', $this -> FONT_WORD);
                    
            //$this->WORD=$this->FONT_WORD;
                    /*
                     取得使用 TrueType 字體的文本的范圍
                     
            */
                    
            $TEMP = imagettfbbox($this -> FONT_SIZE, 0, $this -> FONT_PATH, $this -> WORD);
                    
            $WORD_LENGTH = strlen($this -> WORD);
                    
            $WORD_WIDTH = $TEMP[2- $TEMP[6];
                    
            $WORD_HEIGHT = $TEMP[3- $TEMP[7];
                    
            /*
                     文字水印的默認(rèn)位置為右下角
                     
            */
                    
            if ($this -> WORD_X == "") {
                        
            $this -> WORD_X = $this -> PICTURE_WIDTH - $WORD_WIDTH;
                    }
                    
            if ($this -> WORD_Y == "") {
                        
            $this -> WORD_Y = $this -> PICTURE_HEIGHT - $WORD_HEIGHT;
                    }
                    imagesettile(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE);
                    imagefilledrectangle(
            $this -> TRUE_COLOR, 0, 0, $this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT, IMG_COLOR_TILED);
                    
            $TEXT2 = imagecolorallocate($this -> TRUE_COLOR, $this -> RED, $this -> GREEN, $this -> BLUE);
                    imagettftext(
            $this -> TRUE_COLOR, $this -> FONT_SIZE, $this -> ANGLE, $this -> WORD_X, $this -> WORD_Y, $TEXT2, $this -> FONT_PATH, $this -> WORD);
                }

                
            /*
                 水印圖片
                 
            */
                
            function _mark_picture() {

                    
            /*
                     獲取水印圖片的信息
                     
            */
                    @
            $SIZE = getimagesize($this -> FORCE_URL);
                    
            if (!$SIZE) {
                        
            exit($this -> ERROR['unalviable']);
                    }
                    
            $FORCE_PICTURE_WIDTH = $SIZE[0];
                    
            $FORCE_PICTURE_HEIGHT = $SIZE[1];
                    
            //創(chuàng)建水印圖片
                    switch($SIZE[2]) {
                        
            case 1 :
                            
            $FORCE_PICTURE_CREATE = imagecreatefromgif($this -> FORCE_URL);
                            
            $FORCE_PICTURE_TYPE = "gif";
                            
            break;
                        
            case 2 :
                            
            $FORCE_PICTURE_CREATE = imagecreatefromjpeg($this -> FORCE_URL);
                            
            $FORCE_PICTURE_TYPE = "jpg";
                            
            break;
                        
            case 3 :
                            
            $FORCE_PICTURE_CREATE = imagecreatefrompng($this -> FORCE_URL);
                            
            $FORCE_PICTURE_TYPE = "png";
                            
            break;
                    }
                    
            /*
                     判斷水印圖片的大小,并生成目標(biāo)圖片的大小,如果水印比圖片大,則生成圖片大小為水印圖片的大小。否則生成的圖片大小為原圖片大小。
                     
            */
                    
            $this -> NEW_PICTURE = $this -> PICTURE_CREATE;
                    
            if ($FORCE_PICTURE_WIDTH > $this -> PICTURE_WIDTH) {
                        
            $CREATE_WIDTH = $FORCE_PICTURE_WIDTH - $this -> FORCE_START_X;
                    } 
            else {
                        
            $CREATE_WIDTH = $this -> PICTURE_WIDTH;
                    }
                    
            if ($FORCE_PICTURE_HEIGHT > $this -> PICTURE_HEIGHT) {
                        
            $CREATE_HEIGHT = $FORCE_PICTURE_HEIGHT - $this -> FORCE_START_Y;
                    } 
            else {
                        
            $CREATE_HEIGHT = $this -> PICTURE_HEIGHT;
                    }
                    
            /*
                     創(chuàng)建一個(gè)畫布
                     
            */
                    
            $NEW_PICTURE_CREATE = imagecreatetruecolor($CREATE_WIDTH, $CREATE_HEIGHT);
                    
            $WHITE = imagecolorallocate($NEW_PICTURE_CREATE, 255, 255, 255);
                    
            /*
                     將背景圖拷貝到畫布中
                     
            */
                    imagecopy(
            $NEW_PICTURE_CREATE, $this -> PICTURE_CREATE, 0, 0, 0, 0, $this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);

                    
            /*
                     將目標(biāo)圖片拷貝到背景圖片上
                     
            */
                    imagecopy(
            $NEW_PICTURE_CREATE, $FORCE_PICTURE_CREATE, $this -> FORCE_X, $this -> FORCE_Y, $this -> FORCE_START_X, $this -> FORCE_START_Y, $FORCE_PICTURE_WIDTH, $FORCE_PICTURE_HEIGHT);
                    
            $this -> TRUE_COLOR = $NEW_PICTURE_CREATE;
                }

                
            #end of mark

                
            function alpha_() {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    
            $rgb = "#CDCDCD";
                    
            $tran_color = "#000000";
                    
            for ($j = 0$j <= $this -> PICTURE_HEIGHT - 1$j++) {
                        
            for ($i = 0$i <= $this -> PICTURE_WIDTH - 1$i++) {
                            
            $rgb = imagecolorat($this -> PICTURE_CREATE, $i, $j);
                            
            $r = ($rgb>>16& 0xFF;
                            
            $g = ($rgb>>8& 0xFF;
                            
            $b = $rgb & 0xFF;
                            
            $now_color = imagecolorallocate($this -> PICTURE_CREATE, $r, $g, $b);
                            
            if ($now_color == $tran_color) {
                                
            continue;
                            } 
            else {
                                
            $color = imagecolorallocatealpha($this -> PICTURE_CREATE, $r, $g, $b, $ALPHA);
                                imagesetpixel(
            $this -> PICTURE_CREATE, $ALPHA_X + $i, $ALPHA_Y + $j, $color);
                            }
                            
            $this -> TRUE_COLOR = $this -> PICTURE_CREATE;

                        }
                    }
                }

                
            /*
                 圖片旋轉(zhuǎn):
                 沿y軸旋轉(zhuǎn)
                 
            */
                
            function turn_y() {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    
            for ($x = 0$x < $this -> PICTURE_WIDTH; $x++) {
                        imagecopy(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE, $this -> PICTURE_WIDTH - $x - 1, 0, $x, 0, 1, $this -> PICTURE_HEIGHT);
                    }
                }

                
            function turn_r1() {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> PICTURE_HEIGHT, $this -> PICTURE_WIDTH);
                    
            //exit("==".$this->PICTURE_WIDTH);
                    for ($x = 0$x < $this -> PICTURE_WIDTH; $x += 1) {
                        
            for ($y = 0$y < $this -> PICTURE_HEIGHT; $y += 1) {
                            imagecopy(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE, $y, $x, $this -> PICTURE_WIDTH - $x, $this -> PICTURE_HEIGHT - $y, 1, 1);
                        }
                    }
                }

                
            function turn_r2() {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> PICTURE_HEIGHT, $this -> PICTURE_WIDTH);
                    
            //exit("==".$this->PICTURE_WIDTH);
                    for ($x = 0$x < $this -> PICTURE_WIDTH; $x += 1) {
                        
            for ($y = $this -> PICTURE_HEIGHT; $y > 0$y -= 1) {
                            imagecopy(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE, $y, $x, $x, $y, 1, 1);
                        }
                    }
                }

                
            /*
                 沿X軸旋轉(zhuǎn)
                 
            */
                
            function turn_x() {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    
            for ($y = 0$y < $this -> PICTURE_HEIGHT; $y++) {
                        imagecopy(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE, 0, $this -> PICTURE_HEIGHT - $y - 1, 0, $y, $this -> PICTURE_WIDTH, 1);
                    }
                }

                
            /*
                 任意角度旋轉(zhuǎn)
                 
            */
                
            function turn() {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    imageCopyResized(
            $this -> TRUE_COLOR, $this -> PICTURE_CREATE, 0, 0, 0, 0, $this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT, $this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    
            $WHITE = imagecolorallocate($this -> TRUE_COLOR, 255, 255, 255);
                    
            $this -> TRUE_COLOR = imagerotate($this -> TRUE_COLOR, $this -> CIRCUMROTATE, $WHITE);
                }

                
            /*
                 圖片銳化
                 
            */
                
            function sharp() {
                    
            $this -> TRUE_COLOR = imagecreatetruecolor($this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    
            $cnt = 0;
                    
            for ($x = 0$x < $this -> PICTURE_WIDTH; $x++) {
                        
            for ($y = 0$y < $this -> PICTURE_HEIGHT; $y++) {
                            
            $src_clr1 = imagecolorsforindex($this -> TRUE_COLOR, imagecolorat($this -> PICTURE_CREATE, $x - 1, $y - 1));
                            
            $src_clr2 = imagecolorsforindex($this -> TRUE_COLOR, imagecolorat($this -> PICTURE_CREATE, $x, $y));
                            
            $r = intval($src_clr2["red"+ $this -> SHARP * ($src_clr2["red"- $src_clr1["red"]));
                            
            $g = intval($src_clr2["green"+ $this -> SHARP * ($src_clr2["green"- $src_clr1["green"]));
                            
            $b = intval($src_clr2["blue"+ $this -> SHARP * ($src_clr2["blue"- $src_clr1["blue"]));
                            
            $r = min(255, max($r, 0));
                            
            $g = min(255, max($g, 0));
                            
            $b = min(255, max($b, 0));
                            
            if (($DST_CLR = imagecolorexact($this -> PICTURE_CREATE, $r, $g, $b)) == -1)
                                
            $DST_CLR = imagecolorallocate($this -> PICTURE_CREATE, $r, $g, $b);
                            
            $cnt++;
                            
            if ($DST_CLR == -1)
                                
            die("color allocate faile at $x, $y ($cnt).");
                            imagesetpixel(
            $this -> TRUE_COLOR, $x, $y, $DST_CLR);
                        }
                    }
                }

                
            /*
                 將圖片反色處理??
                 
            */
                
            function return_color() {
                    
            /*
                     創(chuàng)建一個(gè)畫布
                     
            */
                    
            $NEW_PICTURE_CREATE = imagecreate($this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    
            $WHITE = imagecolorallocate($NEW_PICTURE_CREATE, 255, 255, 255);
                    
            /*
                     將背景圖拷貝到畫布中
                     
            */
                    imagecopy(
            $NEW_PICTURE_CREATE, $this -> PICTURE_CREATE, 0, 0, 0, 0, $this -> PICTURE_WIDTH, $this -> PICTURE_HEIGHT);
                    
            $this -> TRUE_COLOR = $NEW_PICTURE_CREATE;
                }

                
            /*
                 生成目標(biāo)圖片并顯示
                 
            */
                
            function show() {
                    
            // 判斷瀏覽器,若是IE就不發(fā)送頭
                    if (isset($_SERVER['HTTP_USER_AGENT'])) {
                        
            $ua = strtoupper($_SERVER['HTTP_USER_AGENT']);
                        
            if (!preg_match('/^.*MSIE.*\)$/i', $ua)) {
                            
            header("Content-type:$this->PICTURE_MIME");
                        }
                    }
                    
            $OUT = $this -> PICTURE_TYPE;
                    
            $OUT($this -> TRUE_COLOR);
                }

                
            /*
                 生成目標(biāo)圖片并保存
                 
            */
                
            function save_picture($showpic = 0) {
                    
            // 以 JPEG 格式將圖像輸出到瀏覽器或文件
                    $OUT = $this -> PICTURE_TYPE;
                    
            if (function_exists($OUT)) {
                        
            // 判斷瀏覽器,若是IE就不發(fā)送頭
                        if (isset($_SERVER['HTTP_USER_AGENT'])) {
                            
            $ua = strtoupper($_SERVER['HTTP_USER_AGENT']);
                            
            if (!preg_match('/^.*MSIE.*\)$/i', $ua)) {
                                
            header("Content-type:$this->PICTURE_MIME");
                            }
                        }
                        
            if (!$this -> TRUE_COLOR) {
                            
            exit($this -> ERROR['unavilable']);
                        } 
            else {
                            
            $OUT($this -> TRUE_COLOR, $this -> DEST_URL);
                            
            if ($showpic) {
                                
            $OUT($this -> TRUE_COLOR);
                            }
                        }
                    }
                }

                
            /*
                 析構(gòu)函數(shù):釋放圖片
                 
            */
                
            function __destruct() {
                    
            /*釋放圖片*/
                    @imagedestroy(
            $this -> TRUE_COLOR);
                    @imagedestroy(
            $this -> PICTURE_CREATE);
                }

                
            #end of class
            }
            ?>

            /*

            以下為調(diào)用方法

            */

            <?php
                
            require_once "Pic_Class.php";
                
                
            $p2 = new picture('22.jpg');
                
            /*
                 $p2->FONT_WORD='我要打水印了,*(^&^%^%$$#,結(jié)束了';
                 $p2->DEST_URL='fontwater.gif';
                 $p2->hex2dec();
                 $p2->_mark_text();
                 $p2->save_picture();
                 
            */
                
                
            /*
                 $p2->FORCE_URL='wt.jpg';
                 $p2->FORCE_X=0;//水印橫坐標(biāo)
                 $p2->FORCE_Y=0;//水印縱坐標(biāo)
                 $p2->FORCE_START_X=0;//切起水印的圖片橫坐標(biāo)
                 $p2->FORCE_START_Y=0;//切起水印的圖片縱坐標(biāo)
                 $p2->_mark_picture();
                 $p2->save_picture(1);
                 
            */
                
                
            /*
                 $p2->ZOOM=0;//縮放類型
                 $p2->ZOOM_MULTIPLE=0.5;//縮放比例
                 $p2->zoom();
                 $p2->save_picture(1);
                 
            */
                
                
            /*
                 $p2->CUT_TYPE=1;//裁切類型
                 $p2->CUT_X=0;//裁切的橫坐標(biāo)
                 $p2->CUT_Y=0;//裁切的縱坐標(biāo)
                 $p2->CUT_WIDTH=100;//裁切的寬度
                 $p2->CUT_HEIGHT=100;//裁切的高度
                 $p2->cut(1);
                 $p2->save_picture(1);
                 
            */
                
                
            /*
                 $p2=new picture('33.jpg');
                 $p2->sharp();
                 $p2->save_picture(1);
                 
            */
                
                
            /*
                 $p2=new picture('33.jpg');
                 $p2->ALPHA='10';//透明度在0-127之間
                 $p2->ALPHA_X="90";
                 $p2->ALPHA_Y="50";
                 $p2->alpha_();
                 $p2->save_picture(1);
                 
            */
                
            $p2 = new picture('22.jpg');
                
            //$p2->turn_y();
                //$p2->turn_x();

                $p2 -> turn_r1();
                
            $p2 -> save_picture(1);
            ?>

            source from: http://hi.baidu.com/%B7%E3%CF%E0%D7%D3/blog/item/acd7843c2134900bbba16761.html
            posted on 2012-01-29 14:59 小果子 閱讀(238) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 學(xué)習(xí)筆記
            97精品国产91久久久久久| 久久综合亚洲色HEZYO国产| 久久狠狠一本精品综合网| 久久久久99精品成人片试看| 久久久国产精华液| 亚洲午夜无码久久久久| 中文字幕久久精品无码| 超级97碰碰碰碰久久久久最新| 久久综合成人网| 亚洲欧美成人久久综合中文网| 久久久久久国产精品无码下载| 久久99热这里只有精品国产 | 久久国产乱子伦免费精品| 久久久久久精品免费看SSS| 久久久亚洲AV波多野结衣| 亚洲午夜无码久久久久小说| 久久人妻少妇嫩草AV无码蜜桃| 久久精品国产欧美日韩| 亚洲国产综合久久天堂| 久久久久免费精品国产| 精品综合久久久久久888蜜芽| 97久久精品国产精品青草| 国产2021久久精品| 久久亚洲日韩看片无码| 狠狠色丁香久久综合婷婷| 精品久久久久久无码中文字幕 | 少妇熟女久久综合网色欲| 久久精品国产亚洲av麻豆蜜芽| 久久综合国产乱子伦精品免费| 久久精品天天中文字幕人妻 | 国产色综合久久无码有码| 精品久久人妻av中文字幕| 久久人人超碰精品CAOPOREN| 中文字幕久久久久人妻| 久久99精品免费一区二区| 无码专区久久综合久中文字幕| 久久久久久狠狠丁香| 久久久久亚洲国产| 久久久久久久尹人综合网亚洲 | 久久久久国产| 久久av无码专区亚洲av桃花岛|