当前位置:   article > 正文

gd 动态 圆角矩形水印 + 抗锯齿_矩形圆角抗锯齿

矩形圆角抗锯齿

gd 圆角矩形水印 + 抗锯齿

示例图

宽度为200的效果图
这是图片宽度为200的时候的效果
#宽度为1000的效果
在这里插入图片描述

可以实现的功能

根据图片大小,按比例生成水印文字和水印的黑色“圆角矩形”背景,其中圆角矩形 是由填充长方形和弧度圆角组成,此时,如果不做抗锯齿,生成的水印会有很明显的锯齿,于是从网上查找资料找到抗锯齿的解决办法,于是我把我的圆角矩形方法也融合了进去,我就是把前人的精华融合了一下,希望对有需要的人能起到帮助作用,由于时间比较急,新加的功能参数什么的没有和原有代码融合,但是可以用,并实现我想要的效果

代码

photo.php 所有的图片调用都会走该路径,进行水印化处理

<?php
include_once('common.php');

$url = empty($_GET['url'])?'':$_GET['url'];
$hight = empty($_GET['hight'])?null:$_GET['hight'];
$width = empty($_GET['width'])?300:$_GET['width'];

$trueurl=authcode($url,'DECODE');


//查询sql
$sql="select nickname from ".tname("cattle_herds")." where headimg='$trueurl' or photo like '%$trueurl%' and isdel=0";
$herds = $_SGLOBAL['db']->fetch_first($sql);
$title="牛编号 ".$herds['nickname'];
img2thumb(BOOT.$trueurl,'',$width,$hight,'','',$title);
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

代码2 function.php 功能方法

function img2thumb($src_img, $dst_img, $width = 75, $height = 75, $cut = 0, $proportion = 0,$title=''){
    if(!is_file($src_img)){
        return false;
    }
    $ot = GetFileType($src_img);
    $otfunc = 'image' . ($ot == 'jpg' ? 'jpeg' : $ot);
    $srcinfo = getimagesize($src_img);
    $src_w = $srcinfo[0];
    $src_h = $srcinfo[1];
    $type  = strtolower(substr(image_type_to_extension($srcinfo[2]), 1));
    $createfun = 'imagecreatefrom' . ($type == 'jpg' ? 'jpeg' : $type);

    $dst_h = $height;
    $dst_w = $width;
    $x = $y = 0;

    /**
     * 缩略图不超过源图尺寸(前提是宽或高只有一个)
     */
    if(($width> $src_w && $height> $src_h) || ($height> $src_h && $width == 0) || ($width> $src_w && $height == 0)){
        $proportion = 1;
    }
    if($width> $src_w){
        $dst_w = $width = $src_w;
    }
    if($height> $src_h){
        $dst_h = $height = $src_h;
    }

    if(!$width && !$height && !$proportion){
        return false;
    }
    if(!$proportion){
        if($cut == 0){
            if($dst_w && $dst_h){
                if($dst_w/$src_w> $dst_h/$src_h){
                    $dst_w = $src_w * ($dst_h / $src_h);
                    $x = 0 - ($dst_w - $width) / 2;
                }else{
                    $dst_h = $src_h * ($dst_w / $src_w);
                    $y = 0 - ($dst_h - $height) / 2;
                }
            }else if($dst_w xor $dst_h){
	            //有宽无高
                if($dst_w && !$dst_h)  {
                    $propor = $dst_w / $src_w;
                    $height = $dst_h  = $src_h * $propor;
                    //有高无宽
                }else if(!$dst_w && $dst_h)  {
                    $propor = $dst_h / $src_h;
                    $width  = $dst_w = $src_w * $propor;
                }
            }
        }else{
	         //裁剪时无高
            if(!$dst_h) {
                $height = $dst_h = $dst_w;
            }
            //裁剪时无宽
            if(!$dst_w){
                $width = $dst_w = $dst_h;
            }
            $propor = min(max($dst_w / $src_w, $dst_h / $src_h), 1);
            $dst_w = (int)round($src_w * $propor);
            $dst_h = (int)round($src_h * $propor);
            $x = ($width - $dst_w) / 2;
            $y = ($height - $dst_h) / 2;
        }
    }else{
        $proportion = min($proportion, 1);
        $height = $dst_h = $src_h * $proportion;
        $width  = $dst_w = $src_w * $proportion;
    }

    $src = $createfun($src_img);
    $dst = imagecreatetruecolor($width ? $width : $dst_w, $height ? $height : $dst_h);
    $white = imagecolorallocate($dst, 255, 255, 255);
    imagefill($dst, 0, 0, $white);

    if(function_exists('imagecopyresampled')){
        imagecopyresampled($dst, $src, $x, $y, 0, 0, $dst_w, $dst_h, $src_w, $src_h);
    }else{
        imagecopyresized($dst, $src, $x, $y, 0, 0, $dst_w, $dst_h, $src_w, $src_h);
    }
    //***该步骤是加水印,上面是对文件压缩指定大小
    if($title){
        //var_dump($dst,$title,$width);
        waterMark($dst,$title,$width);
    }else{
        if($dst_img){
            $otfunc($dst, $dst_img); 
         }else{
             header('Content-type: image/jpg'); 
             imagejpeg($dst);
             //echo $dst;
         }
         
    }
   
    imagedestroy($dst);

    //imagedestroy($src);
    return true;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104

代码3 waterMark()方法

function waterMark($img,$title,$img_width){
    require 'xDraw.class.php';
    $dst=$img;
    $xdraw = new \SimpleChart\xDraw($dst,400,300);
    $xdraw->useAntialias(true);

    //打上文字,由于我用到的是中文水印,所以不能用默认字体,需要自己下载一个字体放进来,或者从本地字体库复制一个过来,务必将字体库的名称改为英文,中文不识别
    $font = realpath('./fangzheng.ttf');//字体路径
    $textcolor = imagecolorallocate($dst, 123, 12, 255);
    $black = imagecolorallocate($dst, 0x00, 0x00, 0x00);//字体颜色
    $white = imagecolorallocate($dst,255, 255, 255);//字体颜色

    // 下面是按比例生成带文字的圆角矩形水印的代码
    $im = imagecreatetruecolor(80,50);
    $fontSize=0.025*$img_width;

    $textInfo=imagefttext($im, $fontSize, 0, 37, 100, $white,$font,$title);
    $t_width=$textInfo[2] - $textInfo[0];
    $t_height=abs($textInfo[5] - $textInfo[3]);
    $bacWidth=$t_width+15/300*$img_width;
    $bacHeight=$t_height+0.03*$img_width;
    $bac_x=2/30*$img_width;
    $bac_y=1/25*$img_width;

    $font_x=27/300*$img_width;
    $font_y=26.5/300*$img_width;

    if($img_width<300){
        $radios=0.035*$img_width;
    }else{
        $radius=10;
    }
    //画背景
    $xdraw->arcRec(intval($bac_x), intval($bac_y), intval($bacWidth), intval($bacHeight), intval($radius));
    //文字
    $xdraw->drawFont(intval($fontSize), 0, intval($font_x), intval($font_y), $white,$font,$title);
    $xdraw->stroke();

}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39

代码4 xDraw.class.php

<?php
namespace SimpleChart;
/**
 * use the same as pDraw,based on GD2
 * this is a free software!
 * 
 * 支持line,arc,image,rect,text,eclipse,beziercurve(future features)
 * 支持阴影,反锯齿
 * 
 * @todo arc条纹问题,beziercurve,lineSize,textAlign
 * @license http://www.apache.org/licenses/LICENSE-2.0
 * @author xilei
 */

class xDraw{
    
    public $AntialiasQuality = 0;//0-100
    //抗锯齿
    protected $Antialias = true;

    protected $UseAlpha = true;

    protected $Width = NULL;
    protected $Height = NULL;
    protected $Image = NULL;
    protected $TransparentBackground = false;
    
    protected $Shadow = false;
    
    protected $CommonFormat = array(
        "FontName"=>"",
        "FontSize"=>12,
        "FontColor"=>array('R'=>0,'G'=>0,'B'=>0,'Alpha'=>100),
        "Color"=>array('R'=>0,'G'=>0,'B'=>0,'Alpha'=>100),
        "BorderColor"=>false
    );
    
    protected $ShadowFormat = NULL;
    
    public function __construct($Src,$Width, $Height, $TransparentBackground = false) {
        $this->TransparentBackground = $TransparentBackground;
        $this->Width = $Width;
        $this->Height = $Height;
        if($Src){
            $this->Image = $Src;
        }else{
            $this->Image = imagecreatetruecolor($Width, $Height);
        }
        if ($this->TransparentBackground) {
            imagealphablending($this->Image, false);
            imagefilledRectangle($this->Image, 0, 0, $Width, $Height, imagecolorallocatealpha($this->Image, 255, 255, 255, 127));
            imagealphablending($this->Image, true);
            imagesavealpha($this->Image, true);
        } else {
            //$C_White = $this->allocateColor(255, 255, 255);
            //imagefilledRectangle($this->Image, 0, 0, $Width, $Height, $C_White);
        }
 
    }
    
   /**
    * 设置阴影
    * @param type $Format
    */
    public function setShadow($Format = "") {
        if(is_bool($Format)){
            $this->Shadow = $Format;
            if($Format && empty($this->ShadowFormat)){
                $this->ShadowFormat=array(
                  'X'=>2,'Y'=>2,'Color'=> array('R'=>0,'G'=>0,'B'=>0,'Alpha'=>10)
                );
            }
        }elseif(is_array($Format)){
            if($Format["X"] == 0 || $Format["Y"] == 0){
                $this->Shadow=false;
            }else{
                $this->Shadow=true;
            }
            $this->ShadowFormat= array(
                'X'=>isset($Format["X"]) ? $Format["X"] : 2,
                'Y'=>isset($Format["Y"]) ? $Format["Y"] : 2,
                'Color'=>isset($Format['Color'])? $Format['Color'] : array('R'=>0,'G'=>0,'B'=>0,'Alpha'=>10)
            );
        }
    }
    
    /**
     * 设置格式
     * @param type $Key
     * @param type $Value
     */
    public function setFormat($Key,$Value){
        if(is_array($Key)){
            $this->CommonFormat=array(
                "FontName"=>isset($Key['FontName']) ? $Key['FontName'] :"",
                "FontSize"=>isset($Key["FontSize"]) ? $Key["FontSize"] : 12,
                "FontColor"=>isset($Key['FontColor']) ? $Key['FontColor'] : array('R'=>0,'G'=>0,'B'=>0,'Alpha'=>100),
                "Color"=>isset($Key['Color']) ? $Key['Color'] : array('R'=>0,'G'=>0,'B'=>0,'Alpha'=>100),
                "BorderColor"=>isset($Key['Color']) ? $Key['Color'] : array('R'=>0,'G'=>0,'B'=>0,'Alpha'=>100)
            );
        }elseif(is_string($Key)&&$Value!==''&&$Value!==NULL){
            $this->CommonFormat[$Key]=$Value;
        }
    }
    
    /**
     * 启用/禁用alpha
     * @param type $enable
     */
    public function useAlpha($enable=true){
        if(!$enable){
            $this->Antialias = false;//disabled antialias
            $this->UseAlpha=false;
        }else{
            $this->UseAlpha=true;
        }
    }
    
    /**
     * 使用/禁用 反锯齿
     * @param type $enable
     */
    public function useAntialias($enable=true){
        $this->Antialias = ($enable == true);
    }

    
    /**
     * 设置线宽
     * @param type $thickness
     * @return boolean
     */
    public function setLineSize($thickness) {
        if (is_numeric($thickness) && $thickness > 0) {
            $this->LineSize = $thickness;
            imagesetthickness($this->Image, $thickness);
        }
    }
    
    /**
     * 图片 PNG
     * @param type $X
     * @param type $Y
     * @param type $FileName
     */
    public function drawFromPNG($X, $Y, $FileName) {
        $this->drawFromImage(1, $FileName, $X, $Y);
    }
    
    /**
     * 图片 GIF
     * @param type $X
     * @param type $Y
     * @param type $FileName
     */
    public function drawFromGIF($X, $Y, $FileName) {
        $this->drawFromImage(2, $FileName, $X, $Y);
    }
    
    /**
     * 图片 JPG
     * @param type $X
     * @param type $Y
     * @param type $FileName
     */
    public function drawFromJPG($X, $Y, $FileName) {
        $this->drawFromImage(3, $FileName, $X, $Y);
    }
    
    /**
     * 图片
     * @param type $PicType
     * @param type $FileName
     * @param type $X
     * @param type $Y
     * @return boolean
     */
    public function drawFromImage($PicType, $FileName, $X, $Y) {
        if (!file_exists($FileName)){
            return false;
        }
        list($Width, $Height) = self::getPicInfo($FileName);
        if ($PicType == 1) {
            $Raster = imagecreatefrompng($FileName);
        } elseif ($PicType == 2) {
            $Raster = imagecreatefromgif($FileName);
        } elseif ($PicType == 3) {
            $Raster = imagecreatefromjpeg($FileName);
        } else {
            return false;
        }

        $RestoreShadow = $this->Shadow;
        if ($this->Shadow) {
            $this->Shadow = false;
            if ($PicType == 3) {
                $this->drawFilledRectangle($X + $this->ShadowFormat['X'], $Y + $this->ShadowFormat['Y'], 
                        $X + $Width + $this->ShadowFormat['X'], $Y + $Height + $this->ShadowFormat['Y'], 
                        array('Color'=>$this->ShadowFormat['Color']));
            } else {
                imagecolortransparent($Raster);
                $ShadowI = $this->ShadowFormat['Color'];
                for ($Xc = 0; $Xc <= $Width - 1; $Xc++) {
                    for ($Yc = 0; $Yc <= $Height - 1; $Yc++) {
                        $RGBa = imagecolorat($Raster, $Xc, $Yc);
                        $Values = imagecolorsforindex($Raster, $RGBa);
                        if ($Values["alpha"] < 120) {
                            $ShadowI['Alpha'] = floor(($this->ShadowFormat['Color']['Alpha'] / 100) * ((100 / 127) * (127 - $Values["alpha"])));
                            $this->drawAlphaPixel($X + $Xc + $this->ShadowFormat['X'], $Y + $Yc + $this->ShadowFormat['Y'],$ShadowI);
                        }
                    }
                }
            }
        }
        $this->Shadow = $RestoreShadow;

        imagecopy($this->Image, $Raster, $X, $Y, 0, 0, $Width, $Height);
        imagedestroy($Raster);
    }   
    
    /**
     * 文字
     * @param type $X
     * @param type $Y
     * @param type $Text
     * @param type $Format
     */
    public function drawText($X, $Y, $Text, $Format = "") {
        $Color = isset($Format['Color']) ? $Format['Color'] :$this->CommonFormat['FontColor'];
        $FontName = isset($Format["FontName"]) ? $Format["FontName"] : $this->CommonFormat['FontName'];
        $FontSize = isset($Format['FontSize']) ? $Format['FontSize'] : $this->CommonFormat['FontSize'];
        $Angle = isset($Format["Angle"]) ? $Format["Angle"] : 0;
        
        $RestoreShadow = $this->Shadow;
        if ($this->Shadow) {
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $C_ShadowColor = $this->allocateColor($ShadowColor);
            imagettftext($this->Image, $FontSize, $Angle, $X + $this->ShadowFormat['X'], $Y + $this->ShadowFormat['Y'], $C_ShadowColor, $FontName, $Text);
            unset($ShadowColor,$C_ShadowColor);
        }
        $C_TextColor = $this->allocateColor($Color);
        imagettftext($this->Image, $FontSize, $Angle, $X, $Y, $C_TextColor, $FontName, $Text);

        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 圆/椭圆
     * @param type $Xc
     * @param type $Yc
     * @param type $Width
     * @param type $Height
     * @param type $Format
     */
    public function drawCircle($Xc, $Yc, $Width, $Height, $Format = "") {
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
        $RestoreShadow = $this->Shadow;
        if ($this->Shadow) {
            $this->Shadow = false;
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $this->drawCircle($Xc + $this->ShadowFormat['X'], $Yc + $this->ShadowFormat['X'], $Width, $Height,array('Color'=>$ShadowColor));
            unset($ShadowColor);
        }
        
        if(!$this->Antialias){
            $C_Color = $this->allocateColor($Color);
            imageellipse($this->Image, $Xc, $Yc, $Width<<1, $Height<<1, $C_Color);
        }else{
            $Step = 360 / (2 * M_PI * max($Width,$Height));
            for($i=0;$i<=360;$i=$i+$Step){
              //这里把sin cos交换不影响绘图
              $Y = cos($i*M_PI/180) * $Height + $Yc;
              $X = sin($i*M_PI/180) * $Width + $Xc;
              $this->drawAntialiasPixel($X,$Y,$Color);
            }
        }
        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 填充圆/椭圆
     * @param type $X
     * @param type $Y
     * @param type $Radius
     * @param type $Format
     */
    public function drawFilledCircle($X, $Y,$Width,$Height,$Format = "") {
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
        $BorderColor = isset($Format['BorderColor']) ? $Format['BorderColor'] : $this->CommonFormat['BorderColor'];
        
        $RestoreShadow = $this->Shadow;
        if ($this->Shadow) {
            $this->Shadow = false;
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $this->drawFilledCircle($X + $this->ShadowFormat['X'], $Y + $this->ShadowFormat['Y'], $Width, $Height,array('Color'=>$ShadowColor));
            unset($ShadowColor);
        }        
        
        $C_Color = $this->allocateColor($Color);
        imagefilledellipse($this->Image, $X, $Y, $Width<<1, $Height<<1, $C_Color);
        if ( $this->Antialias && empty($BorderColor)){
           $this->drawCircle($X,$Y,$Width,$Height,array('Color'=>$Color));
        }
        
        if (!empty($BorderColor)) {
            $this->drawCircle($X, $Y, $Width, $Height,array('Color'=>$BorderColor));
        }
        
        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 填充圆弧
     * @param type $X
     * @param type $Y
     * @param type $Width
     * @param type $Height
     * @param type $Start
     * @param type $End
     * @param type $Format
     */
    public function drawFilledArc($X,$Y,$Width,$Height,$Start,$End,$Format=''){
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
        $BorderColor = isset($Format['BorderColor']) ? $Format['BorderColor'] : $this->CommonFormat['BorderColor'];
        
        $RestoreShadow = $this->Shadow;
        if($this->Shadow){
            $this->Shadow = false;
            //这里简单处理
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $this->drawFilledArc($X+$this->ShadowFormat['X'], $Y+$this->ShadowFormat['Y'], $Width, $Height, $Start, $End,
               array('Color'=>$ShadowColor,'BorderColor'=>false));
            unset($ShadowColor);
        }       
        
        $C_Color =  $this->allocateColor($Color);
        //imagefilledarc($this->Image,$X,$Y,$Width<<1,$Height<<1,$Start,$End,$C_Color,IMG_ARC_PIE);
        imagefilledarc($this->Image,$X,$Y,$Width<<1,$Height<<1,$Start,$End,$C_Color,IMG_ARC_PIE);
        
        if($this->Antialias && empty($BorderColor)){
            $this->drawArc($X,$Y,$Width,$Height,$Start,$End,array("Border"=>true,'Color'=>$Color));
        }
        
        if (!empty($BorderColor)) {
            $this->drawArc($X, $Y, $Width, $Height, $Start, $End,array('Color'=>$BorderColor,'Border'=>true));
        }
        
        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 圆弧(顺时针方向)
     * @param type $Xc
     * @param type $Yc
     * @param type $Width
     * @param type $Height
     * @param type $Start
     * @param type $End
     * @param type $Format
     */
    public function drawArc($Xc,$Yc,$Width,$Height,$Start,$End,$Format=''){
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
        //是否绘制边侧
        $Border = isset($Format['Border']) ? $Format['Border'] : false;
        
        $RestoreShadow = $this->Shadow;
        if($this->Shadow ){
            $this->Shadow = false;
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $this->drawArc($Xc+$this->ShadowFormat['X'], $Yc+$this->ShadowFormat['Y'],
                    $Width, $Height, $Start, $End,array('Color'=>$ShadowColor,'Border'=>$Border));
            unset($ShadowColor);
        }
       
        if($this->Antialias){
            $Step = 360 / (2 * M_PI * max($Width,$Height));
            $End = $End>=$Start ? $End : 360+$End;
            for($i=$Start;$i<=$End;$i=$i+$Step){
              $Y = sin($i*M_PI/180) * $Height + $Yc;
              $X = cos($i*M_PI/180) * $Width + $Xc;
              $this->drawAntialiasPixel($X,$Y,$Color);
            }
        }else{
            $C_Color = $this->allocateColor($Color);    
            imagearc($this->Image, $Xc, $Yc, $Width<<1, $Height<<1, $Start, $End, $C_Color);
        }
        
        if($Border){
            $this->drawLine($Xc, $Yc, cos($Start*M_PI/180) * $Width + $Xc, sin($Start*M_PI/180) * $Height + $Yc,array('Color'=>$Color));
            $this->drawLine($Xc, $Yc, cos($End*M_PI/180) * $Width + $Xc, sin($End*M_PI/180) * $Height + $Yc,array('Color'=>$Color));
        }
        $this->Shadow = $RestoreShadow; 
       
    }
    
    /**
     * @todo 贝塞尔曲线
     */
    public function drawBeziercurve(){
        
    }

    /**
     * 填充矩形
     * @param type $X1
     * @param type $Y1
     * @param type $X2
     * @param type $Y2
     * @param type $Format
     */
    public function drawFilledRectangle($X1, $Y1, $X2, $Y2, $Format = "") {
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
        $BorderColor = isset($Format['BorderColor']) ? $Format['BorderColor'] : $this->CommonFormat['BorderColor'];

        $RestoreShadow = $this->Shadow;
        if ($this->Shadow) {
            $this->Shadow = false;
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $this->drawFilledRectangle($X1 + $this->ShadowFormat['X'], $Y1 + $this->ShadowFormat['Y'], $X2 + $this->ShadowFormat['X'], $Y2 + $this->ShadowFormat['Y'], 
                    array('Color'=>$ShadowColor,'BorderColor'=>false));
            unset($ShadowColor);
        }
        $C_Color = $this->allocateColor( $Color);
        imagefilledrectangle($this->Image, ceil($X1), ceil($Y1), floor($X2), floor($Y2), $C_Color);
        if (!empty($BorderColor)) {
            $this->drawRectangle($X1, $Y1, $X2, $Y2, array('Color'=>$BorderColor));
        }
        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 矩形
     * @param type $X1
     * @param type $Y1
     * @param type $X2
     * @param type $Y2
     * @param type $Format
     */
    public function drawRectangle($X1, $Y1, $X2, $Y2, $Format = "") {
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
        
        $RestoreShadow = $this->Shadow;
        if($this->Shadow){
            $this->Shadow=false;
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $this->drawRectangle($X1 + $this->ShadowFormat['X'], $Y1 + $this->ShadowFormat['Y'], $X2 + $this->ShadowFormat['X'], $Y2 + $this->ShadowFormat['Y'],
                    array('Color'=>$ShadowColor));
            unset($ShadowColor);
        }
        $C_Color = $this->allocateColor($Color);
        imagerectangle($this->Image, $X1, $Y1, $X2, $Y2, $C_Color);
        
        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 线
     * @param type $X1
     * @param type $Y1
     * @param type $X2
     * @param type $Y2
     * @param type $Format
     */
    public function drawLine($X1, $Y1, $X2, $Y2, $Format = "") {
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
        $Style = isset($Format["Style"]) ? $Format["Style"] : -1;//just for no Antialias
        
        $RestoreShadow = $this->Shadow;
        if ($this->Shadow){
            $this->Shadow = false;
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            imageline($this->Image, $X1 + $this->ShadowFormat['X'], $Y1 + $this->ShadowFormat['Y'], 
                    $X2 + $this->ShadowFormat['X'], $Y2 + $this->ShadowFormat['Y'], $this->allocateColor($ShadowColor));
            unset($ShadowColor);
        }
        //仅仅在斜线的时候需要
        if($this->Antialias && !($X1==$X2 || $Y1 == $Y2)){
           $distance = sqrt(pow($X2-$X1,2)+pow($Y2-$Y1,2));
           $xstep = ($X2-$X1)/$distance;
           $ystep = ($Y2-$Y1)/$distance;
           for($i=0;$i<$distance;$i++){
              $X = $i*$xstep + $X1;
              $Y = $i*$ystep + $Y1;
              $this->drawAntialiasPixel($X,$Y,$Color);
           }
        }else{
           if (is_array($Style)) {
              imagesetstyle($this->Image, $Style);
              imageline($this->Image, $X1, $Y1, $X2, $Y2, IMG_COLOR_STYLED);
           } elseif (is_resource($Style)) {
              imagesetbrush($this->Image, $Style);
              imageline($this->Image, $X1, $Y1, $X2, $Y2, IMG_COLOR_STYLEDBRUSHE);
           } else {
              $C_Color = $this->allocateColor($Color);
              imageline($this->Image, $X1, $Y1, $X2, $Y2, $C_Color);
           }
        }
        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 多边形
     * @param type $Points
     * @param type $Format
     * @return boolean
     */
    public function drawPolygon($Points, $Format = "") {
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
       
        $count = count($Points);
        $RestoreShadow = $this->Shadow;
        if ($count < 6) return false;
        
        if ($this->Shadow) {
            $this->Shadow = false;
            $ShadowPoints = array();
            for ($i = 0; $i < $count; $i = $i + 2) {
                $ShadowPoints[] = $Points[$i] + $this->ShadowFormat['X'];
                $ShadowPoints[] = $Points[$i + 1] + $this->ShadowFormat['Y'];
            }
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $this->drawPolygon($ShadowPoints, array('Color'=>$ShadowColor));
            unset($ShadowPoints,$ShadowColor);
        }
        
        if($this->Antialias){
            for($i=0;$i < $count; $i = $i + 2){
                if(!isset($Points[$i+2])){
                    $this->drawLine($Points[$i], $Points[$i+1], $Points[0], $Points[1],array('Color'=>$Color));
                }else{
                    $this->drawLine($Points[$i], $Points[$i+1], $Points[$i+2], $Points[$i+3],array('Color'=>$Color));
                }
            }
        }else{
            imagepolygon($this->Image, $Points, $count/2, $this->allocateColor($Color));
        }
         
        $this->Shadow = $RestoreShadow;
    }
    
    public function drawFilledPolygon($Points,$Format=""){
        $Color = isset($Format['Color']) ? $Format['Color'] : $this->CommonFormat['Color'];
        $BorderColor = isset($Format['BorderColor']) ? $Format['BorderColor'] : $this->CommonFormat['BorderColor'];
        
        $count = count($Points);
        $RestoreShadow = $this->Shadow;
        if ($count < 6) return false;
        if ($this->Shadow) {
            $this->Shadow = false;
            $ShadowPoints = array();
            for ($i = 0; $i < $count; $i = $i + 2) {
                $ShadowPoints[] = $Points[$i] + $this->ShadowFormat['X'];
                $ShadowPoints[] = $Points[$i + 1] + $this->ShadowFormat['Y'];
            }
            $ShadowColor = $this->ShadowFormat['Color'];
            $ShadowColor['Alpha'] = ceil(($Color['Alpha'] / 100) * $this->ShadowFormat['Color']['Alpha']);
            $this->drawFilledPolygon($ShadowPoints, array('Color'=>$ShadowColor, "BorderColor" => false));
            unset($ShadowPoints,$ShadowColor);
        }
        
        $FillColor = $this->allocateColor($Color);
        imagefilledpolygon($this->Image, $Points, $count / 2, $FillColor);
        
        if($this->Antialias && empty($BorderColor)){
            $this->drawPolygon($Points,array('Color'=>$Color));
        }
        
        if (!empty($BorderColor)) {
            $this->drawPolygon($Points,array('Color'=>$BorderColor));
        }
        
        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 像素点
     * @param type $X
     * @param type $Y
     * @param type $Color
     * @return boolean
     */
    public function drawAlphaPixel($X, $Y, $Color='') {
        $Color = !empty($Color) ? $Color :$this->CommonFormat['Color'];
        
        $RestoreShadow = $this->Shadow;
        if ($this->Shadow){
            $this->Shadow = false;
            $L_Shadow = $this->ShadowFormat['Color'];
            $L_Shadow['Alpha'] = floor(($Color['Alpha'] / 100) *$this->ShadowFormat['Color']['Alpha']);
            imagesetpixel($this->Image, $X + $this->ShadowFormat['X'], $Y + $this->ShadowFormat['Y'], $this->allocateColor($L_Shadow));
            uset($L_Shadow);
        }
        $C_Color = $this->allocateColor($Color);
        imagesetpixel($this->Image, $X, $Y, $C_Color);
        $this->Shadow = $RestoreShadow;
    }
    
    /**
     * 抗锯齿像素点
     * @param type $X
     * @param type $Y
     * @param type $Color
     * @return boolean
     */
    public function drawAntialiasPixel($X,$Y,$Color=''){
        $Color = !empty($Color) ? $Color :$this->CommonFormat['Color'];
        $Alpha = $Color['Alpha'];
        $Xi   = floor($X);
        $Yi   = floor($Y);
        if( $Xi == $X && $Yi == $Y){
          $this->drawAlphaPixel($X,$Y,$Color);
        }else{
          $Alpha1 = (1 - ($X - $Xi)) * (1 - ($Y - $Yi)) * $Alpha;
          if ( $Alpha1 > $this->AntialiasQuality ) {
              $Color['Alpha']=$Alpha1;
              $this->drawAlphaPixel($Xi,$Yi,$Color); 
          }
          $Alpha2 = ($X - $Xi) * (1 - ($Y - $Yi)) * $Alpha;
          if ( $Alpha2 > $this->AntialiasQuality ) {
              $Color['Alpha']=$Alpha2;
              $this->drawAlphaPixel($Xi+1,$Yi,$Color);
          }
          $Alpha3 = (1 - ($X - $Xi)) * ($Y - $Yi)  * $Alpha;
          if ( $Alpha3 > $this->AntialiasQuality ) {
               $Color['Alpha']=$Alpha3;
              $this->drawAlphaPixel($Xi,$Yi+1, $Color); 
          }
          $Alpha4 = ($X - $Xi) * ($Y - $Yi) * $Alpha;
          if ( $Alpha4 > $this->AntialiasQuality ) {
               $Color['Alpha']=$Alpha4;
              $this->drawAlphaPixel($Xi+1,$Yi+1, $Color);
           }
         }
    }

    public function filter($filtertype, $params) {
        if ($filtertype == IMG_FILTER_COLORIZE) {
            $params = func_get_args();
            $R = isset($params[1]) ? $params[1] : 0;
            $G = isset($params[2]) ? $params[2] : 0;
            $B = isset($params[3]) ? $params[3] : 0;
            return imagefilter($this->Image, IMG_FILTER_COLORIZE, $R, $G, $B);
        } else {
            return imagefilter($this->Image, $filtertype, $params);
        }
    }

    public function render($FileName,$type="png") {
        if ($this->TransparentBackground) {
            imagealphablending($this->Image, false);
            imagesavealpha($this->Image, true);
        }
        imagepng($this->Image, $FileName);
        switch ($type){
            case 'jpeg':
                header('Content-type: image/jpeg');
                imagejpeg($this->Image,$FileName);
                break;
            default:
                header('Content-type: image/png');
                imagepng($this->Image,$FileName);
        }
    }

    public function stroke($BrowserExpire = false,$type="png") {
        if ($this->TransparentBackground) {
            imagealphablending($this->Image, false);
            imagesavealpha($this->Image, true);
        }

        if ($BrowserExpire) {
            header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
            header("Cache-Control: no-cache");
            header("Pragma: no-cache");
        }
        switch ($type){
            case 'jpeg'://Lost too much
                header('Content-Type: image/jpeg');
                imagejpeg($this->Image);
                break;
            default:
                header('Content-Type: image/png');
                imagepng($this->Image);
        }
        
    }
    
     /**
     * alpha颜色
     * @param type $R
     * @param type $G
     * @param type $B
     * @param type $Alpha
     * @return type
     */
    public function allocateColor($Format, $G='', $B='', $Alpha = 100) {
        if(is_array($Format)){
            extract($Format,EXTR_OVERWRITE);
        }else{
            $R = $Format;
        }
        
        if ($R < 0) {$Format = 0;} if ($R > 255) {$R = 255;}
        if ($G < 0) {$G = 0;} if ($G > 255) {$G = 255;}
        if ($B < 0) {$B = 0;} if ($B > 255) {$B = 255;}
        if ($Alpha < 0) {$Alpha = 0;}
        if ($Alpha > 100) {$Alpha = 100;}

        $Alpha = (127 / 100) * (100 - $Alpha);
        return ($this->UseAlpha ? imagecolorallocatealpha($this->Image, $R, $G, $B, $Alpha)
            :  imagecolorallocate($this->Image, $R, $G, $B));
    }

    public function __destruct() {
        if (!empty($this->Image)){
            imagedestroy($this->Image);
        }
    }
    
    /**
     * 图片信息
     * @param type $FileName
     * @return type
     */
    static public function getPicInfo($FileName) {
        $Infos = getimagesize($FileName);
        $Width = $Infos[0];
        $Height = $Infos[1];
        $Type = $Infos["mime"];

        if ($Type == "image/png") {
            $Type = 1;
        }
        if ($Type == "image/gif") {
            $Type = 2;
        }
        if ($Type == "image/jpeg ") {
            $Type = 3;
        }

        return(array($Width, $Height, $Type));
    }
    
    /**
     * 文字信息
     */
    static public function getTextBox($Text, $FontSize, $FontFile, $FontAngle) {
        $Rect = imagettfbbox($FontSize, $FontAngle, $FontFile, $Text);
        $MinX = min(array($Rect[0], $Rect[2], $Rect[4], $Rect[6]));
        $MaxX = max(array($Rect[0], $Rect[2], $Rect[4], $Rect[6]));
        $MinY = min(array($Rect[1], $Rect[3], $Rect[5], $Rect[7]));
        $MaxY = max(array($Rect[1], $Rect[3], $Rect[5], $Rect[7]));

        return array(
            "left" => abs($MinX) - 1,
            "top" => abs($MinY) - 1,
            "width" => $MaxX - $MinX,
            "height" => $MaxY - $MinY,
            "box" => $Rect
        );
    }  
   	/**下面的这两个方法是我新建的 用于 创建圆角矩形,并加上文字**/
    /** 
     * 创建圆角矩形
     *
     * @param   [object]  $imageObj   [imagecreatefromjpeg() 返回一图像标识符]
     * @param   [int]  $arcRec_SX  [圆角矩形开始的X坐标]
     * @param   [int]  $arcRec_SY  [圆角矩形开始的Y坐标]
     * @param   [int]  $arcRec_W  [圆角矩形的宽度]
     * @param   [int]  $arcRec_H  [圆角矩形的高度]
     * @param   [int]  $redius     [圆角矩形的圆角弧度]
     * @param   []  $color      [php gd库里创建的颜色对象]
     *
     * @return  []              [没有返回值]
     */
    public function arcRec($arcRec_SX, $arcRec_SY, $arcRec_W, $arcRec_H, $redius)
    {
        // $arcRec_SX = 50;         //开始点X坐标
        // $arcRec_SY = 50;         //开始点Y坐标
        // $arcRec_EX = 500;       //结束点X坐标
        // $arcRec_EY = 500;       //结束点Y坐标
        // $redius = 50;           //圆角半径
        //$arcRec_W = $arcRec_EX - $arcRec_SX;
        //$arcRec_H = $arcRec_EY - $arcRec_SY;
        $arcRec_EX = $arcRec_SX + $arcRec_W;
        $arcRec_EY = $arcRec_SY + $arcRec_H;

        $this->drawFilledRectangle($arcRec_SX + $redius, $arcRec_SY, $arcRec_SX + ($arcRec_W - $redius), $arcRec_SY + $redius);        //矩形一
        $this->drawFilledRectangle($arcRec_SX, $arcRec_SY + $redius, $arcRec_SX + $arcRec_W, $arcRec_SY + ($arcRec_H - ($redius * 1)));//矩形二
        $this->drawFilledRectangle($arcRec_SX + $redius, $arcRec_SY + ($arcRec_H - ($redius * 1)), $arcRec_SX + ($arcRec_W - ($redius * 1)), $arcRec_SY + $arcRec_H);//矩形三

        $this->drawFilledArc($arcRec_SX + $redius, $arcRec_SY + $redius, $redius, $redius, 180, 270);   //四分之一圆 - 左上
        $this->drawFilledArc($arcRec_SX + ($arcRec_W - $redius), $arcRec_SY + $redius, $redius, $redius, 270, 360);   //四分之一圆 - 右上
        $this->drawFilledArc($arcRec_SX + $redius, $arcRec_SY + ($arcRec_H - $redius), $redius, $redius, 90, 180);   //四分之一圆 - 左下
        $this->drawFilledArc($arcRec_SX + ($arcRec_W - $redius), $arcRec_SY + ($arcRec_H - $redius), $redius, $redius, 0, 90);   //四分之一圆 - 右下

    }
    public function drawFont($fontSize, $angle, $font_x, $font_y, $white,$font,$title){
        imagefttext($this->Image, $fontSize, $angle, $font_x, $font_y, $white,$font,$title);
    }

}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238
  • 239
  • 240
  • 241
  • 242
  • 243
  • 244
  • 245
  • 246
  • 247
  • 248
  • 249
  • 250
  • 251
  • 252
  • 253
  • 254
  • 255
  • 256
  • 257
  • 258
  • 259
  • 260
  • 261
  • 262
  • 263
  • 264
  • 265
  • 266
  • 267
  • 268
  • 269
  • 270
  • 271
  • 272
  • 273
  • 274
  • 275
  • 276
  • 277
  • 278
  • 279
  • 280
  • 281
  • 282
  • 283
  • 284
  • 285
  • 286
  • 287
  • 288
  • 289
  • 290
  • 291
  • 292
  • 293
  • 294
  • 295
  • 296
  • 297
  • 298
  • 299
  • 300
  • 301
  • 302
  • 303
  • 304
  • 305
  • 306
  • 307
  • 308
  • 309
  • 310
  • 311
  • 312
  • 313
  • 314
  • 315
  • 316
  • 317
  • 318
  • 319
  • 320
  • 321
  • 322
  • 323
  • 324
  • 325
  • 326
  • 327
  • 328
  • 329
  • 330
  • 331
  • 332
  • 333
  • 334
  • 335
  • 336
  • 337
  • 338
  • 339
  • 340
  • 341
  • 342
  • 343
  • 344
  • 345
  • 346
  • 347
  • 348
  • 349
  • 350
  • 351
  • 352
  • 353
  • 354
  • 355
  • 356
  • 357
  • 358
  • 359
  • 360
  • 361
  • 362
  • 363
  • 364
  • 365
  • 366
  • 367
  • 368
  • 369
  • 370
  • 371
  • 372
  • 373
  • 374
  • 375
  • 376
  • 377
  • 378
  • 379
  • 380
  • 381
  • 382
  • 383
  • 384
  • 385
  • 386
  • 387
  • 388
  • 389
  • 390
  • 391
  • 392
  • 393
  • 394
  • 395
  • 396
  • 397
  • 398
  • 399
  • 400
  • 401
  • 402
  • 403
  • 404
  • 405
  • 406
  • 407
  • 408
  • 409
  • 410
  • 411
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418
  • 419
  • 420
  • 421
  • 422
  • 423
  • 424
  • 425
  • 426
  • 427
  • 428
  • 429
  • 430
  • 431
  • 432
  • 433
  • 434
  • 435
  • 436
  • 437
  • 438
  • 439
  • 440
  • 441
  • 442
  • 443
  • 444
  • 445
  • 446
  • 447
  • 448
  • 449
  • 450
  • 451
  • 452
  • 453
  • 454
  • 455
  • 456
  • 457
  • 458
  • 459
  • 460
  • 461
  • 462
  • 463
  • 464
  • 465
  • 466
  • 467
  • 468
  • 469
  • 470
  • 471
  • 472
  • 473
  • 474
  • 475
  • 476
  • 477
  • 478
  • 479
  • 480
  • 481
  • 482
  • 483
  • 484
  • 485
  • 486
  • 487
  • 488
  • 489
  • 490
  • 491
  • 492
  • 493
  • 494
  • 495
  • 496
  • 497
  • 498
  • 499
  • 500
  • 501
  • 502
  • 503
  • 504
  • 505
  • 506
  • 507
  • 508
  • 509
  • 510
  • 511
  • 512
  • 513
  • 514
  • 515
  • 516
  • 517
  • 518
  • 519
  • 520
  • 521
  • 522
  • 523
  • 524
  • 525
  • 526
  • 527
  • 528
  • 529
  • 530
  • 531
  • 532
  • 533
  • 534
  • 535
  • 536
  • 537
  • 538
  • 539
  • 540
  • 541
  • 542
  • 543
  • 544
  • 545
  • 546
  • 547
  • 548
  • 549
  • 550
  • 551
  • 552
  • 553
  • 554
  • 555
  • 556
  • 557
  • 558
  • 559
  • 560
  • 561
  • 562
  • 563
  • 564
  • 565
  • 566
  • 567
  • 568
  • 569
  • 570
  • 571
  • 572
  • 573
  • 574
  • 575
  • 576
  • 577
  • 578
  • 579
  • 580
  • 581
  • 582
  • 583
  • 584
  • 585
  • 586
  • 587
  • 588
  • 589
  • 590
  • 591
  • 592
  • 593
  • 594
  • 595
  • 596
  • 597
  • 598
  • 599
  • 600
  • 601
  • 602
  • 603
  • 604
  • 605
  • 606
  • 607
  • 608
  • 609
  • 610
  • 611
  • 612
  • 613
  • 614
  • 615
  • 616
  • 617
  • 618
  • 619
  • 620
  • 621
  • 622
  • 623
  • 624
  • 625
  • 626
  • 627
  • 628
  • 629
  • 630
  • 631
  • 632
  • 633
  • 634
  • 635
  • 636
  • 637
  • 638
  • 639
  • 640
  • 641
  • 642
  • 643
  • 644
  • 645
  • 646
  • 647
  • 648
  • 649
  • 650
  • 651
  • 652
  • 653
  • 654
  • 655
  • 656
  • 657
  • 658
  • 659
  • 660
  • 661
  • 662
  • 663
  • 664
  • 665
  • 666
  • 667
  • 668
  • 669
  • 670
  • 671
  • 672
  • 673
  • 674
  • 675
  • 676
  • 677
  • 678
  • 679
  • 680
  • 681
  • 682
  • 683
  • 684
  • 685
  • 686
  • 687
  • 688
  • 689
  • 690
  • 691
  • 692
  • 693
  • 694
  • 695
  • 696
  • 697
  • 698
  • 699
  • 700
  • 701
  • 702
  • 703
  • 704
  • 705
  • 706
  • 707
  • 708
  • 709
  • 710
  • 711
  • 712
  • 713
  • 714
  • 715
  • 716
  • 717
  • 718
  • 719
  • 720
  • 721
  • 722
  • 723
  • 724
  • 725
  • 726
  • 727
  • 728
  • 729
  • 730
  • 731
  • 732
  • 733
  • 734
  • 735
  • 736
  • 737
  • 738
  • 739
  • 740
  • 741
  • 742
  • 743
  • 744
  • 745
  • 746
  • 747
  • 748
  • 749
  • 750
  • 751
  • 752
  • 753
  • 754
  • 755
  • 756
  • 757
  • 758
  • 759
  • 760
  • 761
  • 762
  • 763
  • 764
  • 765
  • 766
  • 767
  • 768
  • 769
  • 770
  • 771
  • 772
  • 773
  • 774
  • 775
  • 776
  • 777
  • 778
  • 779
  • 780
  • 781
  • 782
  • 783
  • 784
  • 785
  • 786
  • 787
  • 788
  • 789
  • 790
  • 791
  • 792
  • 793
  • 794
  • 795
  • 796
  • 797
  • 798
  • 799
  • 800
  • 801
  • 802
  • 803
  • 804
  • 805
  • 806
  • 807
  • 808
  • 809
  • 810
  • 811
  • 812

所有代码已提供 ,

下面是我参考的网站:
xDraw.class.php原文件来源

圆角矩形参考网站

第一次原创文章,希望对你有帮助

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/325965
推荐阅读
相关标签
  

闽ICP备14008679号