• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP imagefilltoborder函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中imagefilltoborder函数的典型用法代码示例。如果您正苦于以下问题:PHP imagefilltoborder函数的具体用法?PHP imagefilltoborder怎么用?PHP imagefilltoborder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了imagefilltoborder函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: imgFill

 public function imgFill($color, $x, $y, $border = null)
 {
     if (!isset($border)) {
         imagefill($this->handle[$this->hname], $x, $y, self::getColor($color));
     } else {
         imagefilltoborder($this->handle[$this->hname], $x, $y, self::getColor($border), self::getColor($color));
     }
 }
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:8,代码来源:Drawing.class.php


示例2: apply

 /**
  * {@inheritdoc}
  */
 public function apply()
 {
     $color = $this->allocateColor($this->color);
     $x = $y = $this->size - 1;
     $w = $this->width - $this->size;
     $h = $this->height - $this->size;
     imagerectangle($this->resource, $x, $y, $w, $h, $color);
     imagefilltoborder($this->resource, 0, 0, $color, $color);
     return $this->resource;
 }
开发者ID:Imatic,项目名称:GenemuFormBundle,代码行数:13,代码来源:Border.php


示例3: CreateLine

 function CreateLine($strconn, $schema, $table, $column, $srid, $largo, $ancho, $r, $g, $b, $trans, $zoom, $despX, $despY)
 {
     $conn = pg_connect($strconn) or die("Error de Conexion con la base de datos");
     $imagen = imagecreatetruecolor($largo, $ancho);
     $transparencia = imagecolorallocatealpha($imagen, 0, 0, 0, 127);
     imagefilltoborder($imagen, 50, 50, $transparencia, $transparencia);
     imagesavealpha($imagen, true);
     $color = imagecolorallocatealpha($imagen, $r, $g, $b, $trans);
     $query = "\n        SELECT  gid, string_agg((cast(((ST_X(ST_GeometryN(geometria.geom,1))-medidas.xinicial)/medidas.factor) as varchar)), ',') x,\n                string_agg((cast(( {$ancho} -(ST_Y(ST_GeometryN(geometria.geom,1))-medidas.yinicial)/medidas.factor) as varchar)),',') y \n        FROM\n          (SELECT min(st_xmin(geom)) xinicial, (max(st_xmax(geom))-min(st_xmin(geom)))/ {$ancho} factor,min(st_ymin(geom)) yinicial \n           FROM \n             (SELECT st_setsrid(Box2D(st_buffer(p.centroide,((375336.1936-(375336.1936 * {$zoom} ))/2))), {$srid}) geom FROM \n                (SELECT ST_GeomFROMText(st_astext(st_point( 470971.458311897-((470971.458311897 * {$despX} )/2) , 1072807.08034292-((470971.458311897 * {$despY} )/2) )), {$srid}) centroide) p\n             ) c \n          ) medidas,\n          (SELECT gid ,((ST_DumpPoints((ST_GeometryN(tab.{$column},1)))).{$column}) geom FROM {$schema}.\"{$table}\" tab\n           WHERE st_intersects(\n                (SELECT st_setsrid(Box2D(st_buffer(p.centroide,((375336.1936-(375336.1936 * {$zoom} ))/2))), {$srid}) geom FROM \n                    (SELECT ST_GeomFROMText(st_astext(st_point( 470971.458311897-((470971.458311897 * {$despX} )/2) , 1072807.08034292-((470971.458311897 * {$despY} )/2) )), {$srid}) centroide) p\n                ), tab.{$column})\n          ) geometria\n        GROUP BY gid\n        ";
     $result = pg_query($conn, $query) or die("Error al ejecutar la consulta");
     while ($row = pg_fetch_row($result)) {
         $x = explode(",", $row[1]);
         $y = explode(",", $row[2]);
         for ($i = 0; $i < count($x) - 1; $i++) {
             imageline($imagen, $x[$i], $y[$i], $x[$i + 1], $y[$i + 1], $color);
         }
     }
     return $imagen;
 }
开发者ID:fauricioRojas,项目名称:MultiVisorMapas,代码行数:19,代码来源:graficos.php


示例4: fill

 static function fill($res, $color, $arr, $name = "fill")
 {
     $key = array_keys(self::$element);
     if ($name == $key[6]) {
         return imagefill($res, $arr[0], $arr[1], $color);
     }
     if ($name == $key[2]) {
         return imagefilledarc($res, $arr[0], $arr[1], $arr[2], $arr[3], $arr[4], $arr[5], $color, $arr[6]);
     }
     if ($name == $key[3] || $name == $key[4]) {
         $act = 'imagefilled' . $name;
         return $act($res, $arr[0], $arr[1], $arr[2], $arr[3], $color);
     }
     if ($name == $key[5]) {
         return imagefilledpolygon($res, $arr, end($arr), $color);
     }
     if ($name == $key[7]) {
         return imagefilltoborder($res, $arr[0], $arr[1], end($arr), $color);
     }
     return 'method error';
 }
开发者ID:art-youth,项目名称:framework,代码行数:21,代码来源:img.php


示例5: fill

 static function fill(&$image, $color, $param, $name = 'rectangle')
 {
     switch ($name) {
         case 'fill':
             //填充
             return imagefill($image, $param[0], $param[1], $color);
         case 'arc':
             //弧形填充
             return imagefilledarc($image, $param[0], $param[1], $param[2], $param[3], $param[4], $param[5], $color, $param[6]);
         case 'polygon':
             //填充多边形
             return imagefilledpolygon($image, $param, count($param) / 2, $color);
         case 'border':
             //区域填充到指定颜色的边界为止
             return imagefilltoborder($image, $param[0], $param[1], $param[2], $color);
         default:
             //填充椭圆、矩形
             $fill = 'imagefilled' . $name;
             //ellipse,rectangle
             return $fill($image, $param[0], $param[1], $param[2], $param[3], $color);
     }
 }
开发者ID:mjiong,项目名称:framework,代码行数:22,代码来源:image.php


示例6: fill

 static function fill(&$image, $color, $param, $name = "fill")
 {
     //填充
     if ($name == 'fill') {
         return imagefill($image, $param[0], $param[1], $color);
     }
     //弧形填充
     if ($name == 'arc') {
         return imagefilledarc($image, $param[0], $param[1], $param[2], $param[3], $param[4], $param[5], $color, $param[6]);
     }
     //填充椭圆、矩形
     if ($name == 'ellipse' || $name == 'rectangle') {
         $fill = 'imagefilled' . $name;
         return $fill($image, $param[0], $param[1], $param[2], $param[3], $color);
     }
     //填充多边形
     if ($name == 'polygon') {
         return imagefilledpolygon($image, $param, count($param) / 2, $color);
     }
     //区域填充到指定颜色的边界为止
     if ($name == 'border') {
         return imagefilltoborder($image, $param[0], $param[1], $param[2], $color);
     }
 }
开发者ID:art-youth,项目名称:framework,代码行数:24,代码来源:img.php


示例7: create_used_free_chart

 function create_used_free_chart($width, $height, $used_memory, $free_memory, $title = 'Free & Used Memory (in %)')
 {
     // Check the input parameters to avoid division by zero and weird cases
     if ($free_memory <= 0 && $used_memory <= 0) {
         $free_memory = 1;
         $used_memory = 0;
     }
     $centerX = 120;
     $centerY = 120;
     $diameter = 120;
     $hmargin = 5;
     // left (right) horizontal margin
     $vmargin = 20;
     // top (bottom) vertical margin
     $image = imagecreate($width, $height);
     // colors
     $white = imagecolorallocate($image, 0xff, 0xff, 0xff);
     $black = imagecolorallocate($image, 0x0, 0x0, 0x0);
     $pie_color[1] = imagecolorallocate($image, 0x5c, 0x87, 0xb2);
     $pie_color[2] = imagecolorallocate($image, 0xcb, 0xe1, 0xef);
     $pie_color[3] = imagecolorallocate($image, 0xc0, 0xc0, 0xc0);
     // Label font size
     $labelfont = 2;
     $hfw = imagefontwidth($labelfont);
     $vfw = imagefontheight($labelfont);
     // Border
     imagerectangle($image, $hmargin, $vmargin, $width - $hmargin, $height - $vmargin, $black);
     // Top label
     $titlefont = 3;
     $txtsize = imagefontwidth($titlefont) * strlen($title);
     $hpos = (int) (($width - $txtsize) / 2);
     $vpos = 3;
     // distance from top
     imagestring($image, $titlefont, $hpos, $vpos, $title, $black);
     $total = 0;
     $n = 0;
     $items = array('Used memory' => $used_memory, 'Free memory' => $free_memory);
     //read the arguments into different arrays:
     foreach ($items as $key => $val) {
         $n++;
         $label[$n] = $key;
         $value[$n] = $val;
         $total += $val;
         $arc_dec[$n] = $total * 360;
         $arc_rad[$n] = $total * 2 * pi();
     }
     //the base:
     $arc_rad[0] = 0;
     $arc_dec[0] = 0;
     //count the labels:
     for ($i = 1; $i <= $n; $i++) {
         //calculate the percents:
         $perc[$i] = $value[$i] / $total;
         $percstr[$i] = (string) number_format($perc[$i] * 100, 2) . "%";
         //label with percentage:
         $label[$i] = $percstr[$i];
         //calculate the arc and line positions:
         $arc_rad[$i] = $arc_rad[$i] / $total;
         $arc_dec[$i] = $arc_dec[$i] / $total;
         $hpos = round($centerX + $diameter / 2 * sin($arc_rad[$i]));
         $vpos = round($centerY + $diameter / 2 * cos($arc_rad[$i]));
         imageline($image, $centerX, $centerY, $hpos, $vpos, $black);
         imagearc($image, $centerX, $centerY, $diameter, $diameter, $arc_dec[$i - 1], $arc_dec[$i], $black);
         //calculate the positions for the labels:
         $arc_rad_label = $arc_rad[$i - 1] + 0.5 * $perc[$i] * 2 * pi();
         $hpos = $centerX + 1.1 * ($diameter / 2) * sin($arc_rad_label);
         $vpos = $centerY + 1.1 * ($diameter / 2) * cos($arc_rad_label);
         if ($arc_rad_label > 0.5 * pi() && $arc_rad_label < 1.5 * pi()) {
             $vpos = $vpos - $vfw;
         }
         if ($arc_rad_label > pi()) {
             $hpos = $hpos - $hfw * strlen($label[$i]);
         }
         //display the labels:
         imagestring($image, $labelfont, $hpos, $vpos, $label[$i], $black);
     }
     //fill the parts with their colors:
     for ($i = 1; $i <= $n; $i++) {
         if (round($arc_dec[$i] - $arc_dec[$i - 1]) != 0) {
             $arc_rad_label = $arc_rad[$i - 1] + 0.5 * $perc[$i] * 2 * pi();
             $hpos = $centerX + 0.8 * ($diameter / 2) * sin($arc_rad_label);
             $vpos = $centerY + 0.8 * ($diameter / 2) * cos($arc_rad_label);
             imagefilltoborder($image, $hpos, $vpos, $black, $pie_color[$i]);
         }
     }
     // legend
     $hpos = $centerX + 1.1 * ($diameter / 2) + $hfw * strlen('50.00%');
     $vpos = $centerY - $diameter / 2;
     $i = 1;
     $thumb_size = 5;
     foreach ($items as $key => $value) {
         imagefilledrectangle($image, $hpos, $vpos, $hpos + $thumb_size, $vpos + $thumb_size, $pie_color[$i++]);
         imagestring($image, $labelfont, $hpos + $thumb_size + 5, $vpos, $key, $black);
         $vpos += $vfw + 2;
     }
     return $image;
 }
开发者ID:laiello,项目名称:kangle-php-mysql,代码行数:97,代码来源:wincache.php


示例8: fill

 /**
  * Fills the image with a specified color at the coordinates
  * defined by x and y
  *
  * @param   var col (either an img.Color[] consisting of the flood color and the
  *          border color) or a simple img.Color defining the flood color
  * @param   int x default 0
  * @param   int y default 0
  * @see     php://imagefill
  * @see     php://imagefilltoborder
  */
 public function fill($col, $x = 0, $y = 0)
 {
     if (is_array($col)) {
         imagefilltoborder($this->handle, $x, $y, $col[1]->handle, $col[0]->handle);
     } else {
         imagefill($this->handle, $x, $y, $col->handle);
     }
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:19,代码来源:Image.class.php


示例9: drawFilledArc

 /**
  * Draw a filled arc. Will use the imagefilledarc() function if available,
  * and otherwise fall back on a custom method of achieving the same
  * result.
  *
  * @see ImageCanvas::drawArc
  * @param int $x X coordinate
  * @param int $y Y coordinate
  * @param int $width The width of the circle
  * @param int $height The height of the circle
  * @param int $start Starting angle, 0 being north
  * @param int $end Ending angle
  * @param Color $color The color
  */
 function drawFilledArc($x, $y, $width, $height, $start, $end, Color $color)
 {
     $sa = ($start - 90) % 360;
     $ea = ($end - 90) % 360;
     if (function_exists('imagefilledarc')) {
         imagefilledarc($this->himage, $x, $y, $width, $height, $sa - 90, $ea - 90, $color->getColor($this->himage), IMG_ARC_PIE);
     } else {
         $ch = $color->getColor($this->himage);
         imagearc($this->himage, $x, $y, $width, $height, $sa, $ea, $ch);
         $p1x = cos($sa * PI / 180);
         $p1y = sin($sa * PI / 180);
         $p2x = cos($ea * PI / 180);
         $p2y = sin($ea * PI / 180);
         imageline($this->himage, $x, $y, $x + $p1x * ($width / 2), $y + $p1y * ($height / 2), $ch);
         imageline($this->himage, $x, $y, $x + $p2x * ($width / 2), $y + $p2y * ($height / 2), $ch);
         $xmin = min($x, $p1x, $p2x);
         $xmax = max($x, $p1x, $p2x);
         $ymin = min($y, $p1y, $p2y);
         $ymax = max($y, $p1y, $p2y);
         $xc = ($xmax + $xmin) / 2;
         $yc = ($ymax + $ymin) / 2;
         // TODO: This fill doesn't work
         imagefilltoborder($this->himage, $xc, $yc, $ch, $ch);
     }
 }
开发者ID:noccy80,项目名称:lepton-ng,代码行数:39,代码来源:canvaspainter.php


示例10: roundcorner

 public function roundcorner($sourceImageFile, $outputfile, $radius = '8')
 {
     # test source image
     if (file_exists($sourceImageFile)) {
         $res = is_array($info = getimagesize($sourceImageFile));
     } else {
         $res = false;
     }
     # open image
     if ($res) {
         $w = $info[0];
         $h = $info[1];
         switch ($info['mime']) {
             case 'image/jpeg':
                 $src = imagecreatefromjpeg($sourceImageFile);
                 break;
             case 'image/gif':
                 $src = imagecreatefromgif($sourceImageFile);
                 break;
             case 'image/png':
                 $src = imagecreatefrompng($sourceImageFile);
                 break;
             default:
                 $res = false;
         }
     }
     # create corners
     if ($res) {
         $q = 10;
         # change this if you want
         $radius *= $q;
         # find unique color
         do {
             $r = rand(0, 255);
             $g = rand(0, 255);
             $b = rand(0, 255);
         } while (imagecolorexact($src, $r, $g, $b) < 0);
         $nw = $w * $q;
         $nh = $h * $q;
         $img = imagecreatetruecolor($nw, $nh);
         $alphacolor = imagecolorallocatealpha($img, $r, $g, $b, 127);
         imagealphablending($img, false);
         imagesavealpha($img, true);
         imagefilledrectangle($img, 0, 0, $nw, $nh, $alphacolor);
         imagefill($img, 0, 0, $alphacolor);
         imagecopyresampled($img, $src, 0, 0, 0, 0, $nw, $nh, $w, $h);
         imagearc($img, $radius - 1, $radius - 1, $radius * 2, $radius * 2, 180, 270, $alphacolor);
         imagefilltoborder($img, 0, 0, $alphacolor, $alphacolor);
         imagearc($img, $nw - $radius, $radius - 1, $radius * 2, $radius * 2, 270, 0, $alphacolor);
         imagefilltoborder($img, $nw - 1, 0, $alphacolor, $alphacolor);
         imagearc($img, $radius - 1, $nh - $radius, $radius * 2, $radius * 2, 90, 180, $alphacolor);
         imagefilltoborder($img, 0, $nh - 1, $alphacolor, $alphacolor);
         imagearc($img, $nw - $radius, $nh - $radius, $radius * 2, $radius * 2, 0, 90, $alphacolor);
         imagefilltoborder($img, $nw - 1, $nh - 1, $alphacolor, $alphacolor);
         imagealphablending($img, true);
         imagecolortransparent($img, $alphacolor);
         # resize image down
         $dest = imagecreatetruecolor($w, $h);
         imagealphablending($dest, false);
         imagesavealpha($dest, true);
         imagefilledrectangle($dest, 0, 0, $w, $h, $alphacolor);
         imagecopyresampled($dest, $img, 0, 0, 0, 0, $w, $h, $nw, $nh);
         $res = $dest;
         imagepng($res, $outputfile);
     }
 }
开发者ID:belamide09,项目名称:mysite,代码行数:66,代码来源:ImageComponent.php


示例11: transform

 public function transform(CGImageBase $src)
 {
     $width = $src['width'];
     $height = $src['height'];
     $radius = $this->_radius;
     $type = $src['type'];
     $color = null;
     $r = $g = $b = 255;
     if ($src->supports_transparency() && !$this->_color) {
         $this->_color = 'transparent';
     }
     if ($this->_color == 'transparent') {
         $type = 'image/png';
     }
     $_dest = new CGImageBase(array($type, $width, $height));
     imagecopy($_dest['rsrc'], $src['rsrc'], 0, 0, 0, 0, $width, $height);
     if ($this->_color) {
         if ($this->_color == 'transparent') {
             // get the dest imagages transparent color.
             $color = $_dest['transparent'];
             if (!$color) {
                 list($r, $g, $b) = cgsi_utils::find_unused_color($_dest);
             }
         } else {
             // use the specified rgb.
             list($r, $g, $b) = cgsi_utils::color_to_rgb($this->_color);
         }
     }
     if (!$color) {
         if ($this->_color == 'transparent') {
             $color = imagecolorallocatealpha($_dest['rsrc'], $r, $g, $b, 127);
         } else {
             $color = imagecolorallocate($_dest['rsrc'], $r, $g, $b);
         }
     }
     if ($this->_color == 'transparent') {
         $_dest['transparent'] = $color;
         imagecolortransparent($_dest['rsrc'], $color);
         imagealphablending($_dest['rsrc'], FALSE);
     }
     // round the corners.
     imagearc($_dest['rsrc'], $radius - 1, $radius - 1, $radius * 2, $radius * 2, 180, 270, $color);
     imagefilltoborder($_dest['rsrc'], 0, 0, $color, $color);
     imagearc($_dest['rsrc'], $width - $radius, $radius - 1, $radius * 2, $radius * 2, 270, 0, $color);
     imagefilltoborder($_dest['rsrc'], $width - 1, 0, $color, $color);
     imagearc($_dest['rsrc'], $radius - 1, $height - $radius, $radius * 2, $radius * 2, 90, 180, $color);
     imagefilltoborder($_dest['rsrc'], 0, $height - 1, $color, $color);
     imagearc($_dest['rsrc'], $width - $radius, $height - $radius, $radius * 2, $radius * 2, 0, 90, $color);
     imagefilltoborder($_dest['rsrc'], $width - 1, $height - 1, $color, $color);
     return $_dest;
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:51,代码来源:class.CGImage_Roundedcorners_Filter.php


示例12: makeThumbWatermark

 function makeThumbWatermark($width = 128, $height = 128)
 {
     $this->fileCheck();
     $image_info = $this->getInfo($this->src_image_name);
     if (!$image_info) {
         return false;
     }
     $src_image_type = $image_info["type"];
     $img = $this->createImage($src_image_type, $this->src_image_name);
     if (!$img) {
         return false;
     }
     $width = $width == 0 ? $image_info["width"] : $width;
     $height = $height == 0 ? $image_info["height"] : $height;
     $width = $width > $image_info["width"] ? $image_info["width"] : $width;
     $height = $height > $image_info["height"] ? $image_info["height"] : $height;
     $srcW = $image_info["width"];
     $srcH = $image_info["height"];
     if ($srcH * $width > $srcW * $height) {
         $width = round($srcW * $height / $srcH);
     } else {
         $height = round($srcH * $width / $srcW);
     }
     //*
     $src_image = @imagecreatetruecolor($width, $height);
     $white = @imagecolorallocate($src_image, 0xff, 0xff, 0xff);
     @imagecolortransparent($src_image, $white);
     @imagefilltoborder($src_image, 0, 0, $white, $white);
     if ($src_image) {
         ImageCopyResampled($src_image, $img, 0, 0, 0, 0, $width, $height, $image_info["width"], $image_info["height"]);
     } else {
         $src_image = imagecreate($width, $height);
         ImageCopyResized($src_image, $img, 0, 0, 0, 0, $width, $height, $image_info["width"], $image_info["height"]);
     }
     $src_image_w = ImageSX($src_image);
     $src_image_h = ImageSY($src_image);
     if ($this->wm_image_name) {
         $wm_image_info = $this->getInfo($this->wm_image_name);
         if (!$wm_image_info) {
             return false;
         }
         $wm_image_type = $wm_image_info["type"];
         $wm_image = $this->createImage($wm_image_type, $this->wm_image_name);
         $wm_image_w = ImageSX($wm_image);
         $wm_image_h = ImageSY($wm_image);
         $temp_wm_image = $this->getPos($src_image_w, $src_image_h, $this->wm_image_pos, $wm_image);
         if ($this->emboss && function_exists("imagefilter")) {
             imagefilter($wm_image, IMG_FILTER_EMBOSS);
             $bgcolor = imagecolorclosest($wm_image, 0x7f, 0x7f, 0x7f);
             imagecolortransparent($wm_image, $bgcolor);
         }
         if (function_exists("ImageAlphaBlending") && IMAGETYPE_PNG == $wm_image_info['type']) {
             ImageAlphaBlending($src_image, true);
         }
         $wm_image_x = $temp_wm_image["dest_x"];
         $wm_image_y = $temp_wm_image["dest_y"];
         if (IMAGETYPE_PNG == $wm_image_info['type']) {
             imageCopy($src_image, $wm_image, $wm_image_x, $wm_image_y, 0, 0, $wm_image_w, $wm_image_h);
         } else {
             imageCopyMerge($src_image, $wm_image, $wm_image_x, $wm_image_y, 0, 0, $wm_image_w, $wm_image_h, $this->wm_image_transition);
         }
     }
     if ($this->wm_text) {
         $this->wm_text = $this->wm_text;
         $temp_wm_text = $this->getPos($src_image_w, $src_image_h, $this->wm_image_pos);
         $wm_text_x = $temp_wm_text["dest_x"];
         $wm_text_y = $temp_wm_text["dest_y"];
         if (preg_match("/([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i", $this->wm_text_color, $color)) {
             $red = hexdec($color[1]);
             $green = hexdec($color[2]);
             $blue = hexdec($color[3]);
             $wm_text_color = imagecolorallocate($src_image, $red, $green, $blue);
         } else {
             $wm_text_color = imagecolorallocate($src_image, 255, 255, 255);
         }
         imagettftext($src_image, $this->wm_text_size, $this->wm_angle, $wm_text_x, $wm_text_y, $wm_text_color, $this->wm_text_font, $this->wm_text);
     }
     if ($this->save_file) {
         switch ($src_image_type) {
             case 1:
                 if ($this->gif_enable) {
                     $src_img = ImageGIF($src_image, $this->save_file);
                 } else {
                     $src_img = ImagePNG($src_image, $this->save_file);
                 }
                 break;
             case 2:
                 $src_img = ImageJPEG($src_image, $this->save_file, $this->jpeg_quality);
                 break;
             case 3:
                 $src_img = ImagePNG($src_image, $this->save_file);
                 break;
             default:
                 $src_img = ImageJPEG($src_image, $this->save_file, $this->jpeg_quality);
                 break;
         }
     } else {
         switch ($src_image_type) {
             case 1:
                 if ($this->gif_enable) {
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:MyShop,代码行数:101,代码来源:mdl.gdimage.php


示例13: imagecreatetruecolor

<?php

// Create a image
$image = imagecreatetruecolor(100, 100);
// Draw a rectangle
imagefilledrectangle($image, 0, 0, 100, 100, imagecolorallocate($image, 255, 255, 255));
// Draw an ellipse to fill with a black border
imageellipse($image, 50, 50, 50, 50, imagecolorallocate($image, 0, 0, 0));
// Try to fill border
imagefilltoborder($image, 50, 50);
?>
 
开发者ID:badlamer,项目名称:hhvm,代码行数:11,代码来源:imagefilltoborder_error7.php


示例14: setBackground

 private function setBackground()
 {
     $color = imagecolorallocate($this->image, 48, 63, 68);
     imagefilltoborder($this->image, 0, 0, $color, $color);
 }
开发者ID:humor-zo,项目名称:chaofan,代码行数:5,代码来源:captcha.class.php


示例15: create


//.........这里部分代码省略.........
                 $posY = $boxHeight / 2 + 10 - 300 - $posYDiff;
             } else {
                 $posY = $boxHeight / 2 + 10 - 200 - $posYDiff;
             }
         } else {
             $posY = $boxHeight / 2 + 10 - $posYDiff;
         }
         $posX = $boxWidth / 2 - $width / 2 + 10;
         if (!empty($hasBorder)) {
             $posY = $boxHeight / 2 + 10 - 150 - $borderWidth - $posYDiff;
             $posX = $boxWidth / 2 - $width / 2;
         }
     }
     if ($fontNotForMaterial) {
         imagettftext($bgTexture, $fontSize, 0, $posX, 60, $textColorBlack, $fontFile, $text);
     } else {
         imagettftext($bgTexture, $fontSize, 0, $posX, $posY, $textColorBlack, $fontFile, $text);
     }
     $im = imagecreatetruecolor($boxWidth, $boxHeight);
     if (!empty($dealerCopy)) {
         imagecopy($im, $bgTexture, $borderWidth, $borderWidth, 0, 0, $boxWidth, $boxHeight);
     } else {
         imagecopy($im, $bgTexture, 0, 0, 0, 0, $boxWidth, $boxHeight);
     }
     $img = imagecreatetruecolor($boxWidth, $boxHeight);
     imagecopymerge($img, $im, 0, 0, 0, 0, $boxWidth, $boxHeight, 100);
     if ($hasBorder) {
         imagecopy($img, $logo, 234, $brandingHeightPosition - 45, 0, 0, imagesx($logo), imagesy($logo));
     } else {
         imagecopy($img, $logo, 245, $brandingHeightPosition - 35, 0, 0, $boxWidth, $boxHeight);
     }
     if (!empty($dealerCopy)) {
         // Add border
         imagefilltoborder($img, 1, 1, $textColorBlack, $white);
     }
     // </editor-fold>
     // <editor-fold defaultstate="collapsed" desc="ADDON">
     $totalAddon = 0;
     if (!empty($options['addon'])) {
         $addonDroppableTop = zbase_config_get('zivsluck.addons.configuration.droppable.top') - 5;
         $addonDroppableLeft = zbase_config_get('zivsluck.addons.configuration.droppable.left') - 5;
         $addonDroppableHeight = zbase_config_get('zivsluck.addons.configuration.droppable.height');
         $addonDroppableWidth = zbase_config_get('zivsluck.addons.configuration.droppable.width');
         $addons = explode('|', $options['addon']);
         $includedAddons = [];
         foreach ($addons as $addon) {
             if (!empty($addon)) {
                 //					$addon = explode('-', $addon);
                 //					$addonName = !empty($addon[0]) ? $addon[0] : false;
                 //					$addonEnabled = zbase_config_get('zivsluck.addons.' . $addonName . '.enable');
                 //					$addonFile = zivsluck()->path() . 'resources/assets/img/addons/' . zbase_config_get('zivsluck.addons.' . $addonName . '.file');
                 //					$addonPosition = !empty($addon[1]) ? explode(',', $addon[1]) : false;
                 //					$addonSize = !empty($addon[2]) ? explode('x', $addon[2]) : false;
                 //					$addonRotate = intval(!empty($addon[3]) ? $addon[3] : false);
                 $addon = explode('-', $addon);
                 $addonName = !empty($addon[0]) ? $addon[0] : false;
                 $addonEnabled = true;
                 //zbase_config_get('zivsluck.addons.' . $addonName . '.enable');
                 $addonFile = zivsluck()->path() . 'resources/assets/img/addons/' . $addonName . '.png';
                 $addonPosition = !empty($addon[1]) ? explode(',', $addon[1]) : false;
                 $addonSize = !empty($addon[2]) ? explode('x', $addon[2]) : false;
                 $addonRotate = intval(!empty($addon[3]) ? $addon[3] : false);
                 if (!empty($addonEnabled) && file_exists($addonFile)) {
                     if (!in_array($addonName, $tags)) {
                         $tags[] = $addonName;
                     }
开发者ID:dennesabing,项目名称:zivsluck,代码行数:67,代码来源:CreateText.php


示例16: imagecreatetruecolor

<?php

// Create a image
$image = imagecreatetruecolor(100, 100);
// Draw a rectangle
imagefilledrectangle($image, 0, 0, 100, 100, imagecolorallocate($image, 255, 255, 255));
// Draw an ellipse to fill with a black border
imageellipse($image, 50, 50, 50, 50, imagecolorallocate($image, 0, 0, 0));
// Fill border
imagefilltoborder($image, 50, 50, imagecolorallocate($image, 0, 0, 0), imagecolorallocate($image, 255, 0, 0));
ob_start();
imagepng($image, null, 9);
$img = ob_get_contents();
ob_end_clean();
echo md5(base64_encode($img));
?>
 
开发者ID:badlamer,项目名称:hhvm,代码行数:16,代码来源:imagefilltoborder_basic.php


示例17: Round

 public function Round($radius = 12, $corners = array(true), $bg = NULL, $img = NULL)
 {
     $orig_dimensions = $this->GetDimensions();
     if (is_null($img)) {
         $img = $this->img;
     } else {
         $orig_dimensions[0] = imagesx($img);
         $orig_dimensions[1] = imagesy($img);
     }
     if (count($corners) == 1) {
         $top_left = $corners[0];
         $top_right = $corners[0];
         $bottom_left = $corners[0];
         $bottom_right = $corners[0];
     } else {
         if (count($corners) == 4) {
             $top_left = $corners[0];
             $top_right = $corners[1];
             $bottom_right = $corners[2];
             $bottom_left = $corners[3];
         } else {
             die('Insufficient Arguments for Corners');
         }
     }
     $this->new_img = imagecreatetruecolor($orig_dimensions[0], $orig_dimensions[1]);
     //get background color
     if (is_null($bg)) {
         $palette = imagecreatetruecolor($orig_dimensions[0], $orig_dimensions[1]);
         $found = false;
         while ($found == false) {
             $r = rand(0, 255);
             $g = rand(0, 255);
             $b = rand(0, 255);
             if (imagecolorexact($img, $r, $g, $b) != -1) {
                 $backcolor = imagecolorallocate($palette, $r, $g, $b);
                 $found = true;
             }
         }
     }
     $endsize = $radius;
     $startsize = $endsize * 3 - 1;
     $arcsize = $startsize * 2 + 1;
     $background = imagecreatetruecolor($orig_dimensions[0], $orig_dimensions[1]);
     imagecopymerge($background, $img, 0, 0, 0, 0, $orig_dimensions[0], $orig_dimensions[1], 100);
     $startx = $orig_dimensions[0] - $startsize;
     $starty = $orig_dimensions[1] - $startsize;
     //echo $startsize;
     imagecopyresampled($this->new_img, $img, 0, 0, 0, 0, $orig_dimensions[0], $orig_dimensions[0], $orig_dimensions[0], $orig_dimensions[1]);
     $bg = imagecolorallocate($this->new_img, hexdec(substr($backcolor, 0, 2)), hexdec(substr($backcolor, 2, 2)), hexdec(substr($backcolor, 4, 2)));
     //$fg = imagecolorallocate($this->new_img, hexdec(substr($forecolor,0,2)),hexdec(substr($forecolor,2,2)),hexdec(substr($forecolor,4,2)));
     //top-left corner
     if ($top_left == true) {
         imagearc($this->new_img, $startsize, $startsize, $arcsize, $arcsize, 180, 270, $bg);
         imagefilltoborder($this->new_img, 0, 0, $bg, $bg);
     }
     // Bottom-left corner
     if ($bottom_left == true) {
         imagearc($this->new_img, $startsize, $starty, $arcsize, $arcsize, 90, 180, $bg);
         imagefilltoborder($this->new_img, 0, $orig_dimensions[1], $bg, $bg);
     }
     // Bottom-right corner
     if ($bottom_right == true) {
         imagearc($this->new_img, $startx, $starty, $arcsize, $arcsize, 0, 90, $bg);
         imagefilltoborder($this->new_img, $orig_dimensions[0], $orig_dimensions[1], $bg, $bg);
     }
     // Top-right corner
     if ($top_right == true) {
         imagearc($this->new_img, $startx, $startsize, $arcsize, $arcsize, 270, 360, $bg);
         imagefilltoborder($this->new_img, $orig_dimensions[0], 0, $bg, $bg);
     }
     imagecolortransparent($this->new_img, $bg);
 }
开发者ID:OiNutter,项目名称:ImageHandler,代码行数:72,代码来源:ImageHandler.php


示例18: create


//.........这里部分代码省略.........
                     $this->ld = $this->larg + $this->disbar;
                     $this->w = $this->ld * $this->cnt + $this->s + $this->d;
                 }
             }
         } else {
             while ($this->ld * $this->cnt + $this->s + $this->d >= $this->w) {
                 $this->larg -= 0.01;
                 $this->disbar = $this->larg;
                 $this->ld = $this->larg + $this->disbar;
             }
             while ($this->ld * $this->cnt + $this->s + $this->d <= $this->w) {
                 $this->larg += 0.01;
                 $this->disbar = $this->larg;
                 $this->ld = $this->larg + $this->disbar;
             }
         }
         if (!isset($this->h)) {
             $this->h = round(3 / 4 * $this->w);
         }
         $this->b += 2 * $this->font_small;
         if ($this->mnvs > 0 && $this->mass > 0) {
             $this->mul = ($this->h - $this->a - $this->b) / ($this->mass - $this->mnvs);
         } else {
             $this->mul = ($this->h - $this->a - $this->b) / ($this->mass + $this->scarmax + (abs($this->mn) - $this->scarmin));
         }
         $this->div = $this->dvx * $this->mul;
         $this->im = imagecreatetruecolor($this->w, $this->h);
         $rgb = Color::hex2rgb($this->axis_color);
         $this->axis_color = imagecolorallocate($this->im, $rgb[0], $rgb[1], $rgb[2]);
         $rgb = Color::hex2rgb($this->font_color);
         $this->font_color = imagecolorallocate($this->im, $rgb[0], $rgb[1], $rgb[2]);
         $rgb = Color::hex2rgb($this->bg_color);
         $this->bg_color = imagecolorallocate($this->im, $rgb[0], $rgb[1], $rgb[2]);
         imagefilltoborder($this->im, 1, 1, 1, $this->bg_color);
         if (isset($this->legend) || isset($this->name)) {
             graidle::legend();
         }
         graidle::title($this->title, $this->xAxis, $this->yAxis);
         graidle::gradAxis($this->sx, $this->sy);
         if (in_array("b", $this->type)) {
             include "graidle_histo.ext.php";
             histogram::drawHisto();
         }
         graidle::drawAxis();
         if (in_array("l", $this->type)) {
             include "graidle_line.ext.php";
             line::drawLine();
         }
     } else {
         if (in_array("hb", $this->type)) {
             for ($bar = $i = 0; $i < count($this->type); $i++) {
                 if ($this->type[$i] == 'hb') {
                     $bar += 1;
                 }
             }
             $this->disbar = $this->larg * $bar;
             if (isset($this->name)) {
                 graidle::setLegend($this->name);
             }
             if (!isset($this->mass)) {
                 $this->mass = $this->mx;
             }
             if (!isset($this->mnvs)) {
                 $this->mnvs = $this->mn;
             }
             if (!isset($this->dvx)) {
开发者ID:NickCis,项目名称:LigaPes,代码行数:67,代码来源:graidle.php


示例19: imagecreatetruecolor

<?php

// Create a image
$image = imagecreatetruecolor(100, 100);
// Draw a rectangle
imagefilledrectangle($image, 0, 0, 100, 100, imagecolorallocate($image, 255, 255, 255));
// Draw an ellipse to fill with a black border
imageellipse($image, 50, 50, 50, 50, imagecolorallocate($image, 0, 0, 0));
// Try to fill border
imagefilltoborder($image, 50, 50, 'wrong param', imagecolorallocate($image, 255, 0, 0));
?>
 
开发者ID:badlamer,项目名称:hhvm,代码行数:11,代码来源:imagefilltoborder_error4.php


示例20: DrawPie

 function DrawPie()
 {
     $fsize = $this->Fsize;
     $image = imagecreate($this->a * 2 + 40, $this->b * 2 + 40);
     $PieCenterX = $this->a + 10;
     $PieCenterY = $this->b + 10;
     $DoubleA = $this->a * 2;
     $DoubleB = $this->b * 2;
     list($R, $G, $B) = getRGB(0);
     $colorBorder = imagecolorallocate($image, $R, $G, $B);
     $DataNumber = count($this->DataArray);
     //$DataTotal
     for ($i = 0; $i < $DataNumber; $i++) {
         $DataTotal += $this->DataArray[$i];
     }
     //算出数据和
     //填充背景
     imagefill($image, 0, 0, imagecolorallocate($image, 255, 255, 255));
     /* 
      ** 画每一个扇形 
      */
     $Degrees = 0;
     for ($i = 0; $i < $DataNumber; $i++) {
         $StartDegrees = round($Degrees);
         $Degrees += $this->DataArray[$i] / $DataTotal * 360;
         $EndDegrees = round($Degrees);
         $percent = number_format($this->DataArray[$i] / $DataTotal * 100, 1);
         if ($this->ColorArray[$i]) {
             $aColor = $this->ColorArray[$i];
         } else {
             $aColor = $this->getRanColor();
         }
         list($R, $G, $B) = getRGB(hexdec($aColor));
         $CurrentColor = imagecolorallocate($image, $R, $G, $B);
         if ($R > 60 and $R < 256) {
             $R = $R - 60;
         }
         if ($G > 60 and $G < 256) {
             $G = $G - 60;
         }
         if ($B > 60 and $B < 256) {
             $B = $B - 60;
         }
         $CurrentDarkColor = imagecolorallocate($image, $R, $G, $B);
         //画扇形弧
         imagearc($image, $PieCenterX, $PieCenterY, $DoubleA, $DoubleB, $StartDegrees, $EndDegrees, $CurrentColor);
         //画直线
         list($ArcX, $ArcY) = pie_point($StartDegrees, $this->a, $this->b);
         imageline($image, $PieCenterX, $PieCenterY, floor($PieCenterX + $ArcX), floor($PieCenterY + $ArcY), $CurrentColor);
         //画直线
         list($ArcX, $ArcY) = pie_point($EndDegrees, $this->a, $this->b);
         imageline($image, $PieCenterX, $PieCenterY, ceil($PieCenterX + $ArcX), ceil($PieCenterY + $ArcY), $CurrentColor);
         //填充扇形
         $MidPoint = round(($EndDegrees - $StartDegrees) / 2 + $StartDegrees);
         list($ArcX, $ArcY) = Pie_point($MidPoint, $this->a * 3 / 4, $this->b * 3 / 4);
         //simkai.ttf
         imagefilltoborder($image, floor($PieCenterX + $ArcX), floor($PieCenterY + $ArcY), $CurrentColor, $CurrentColor);
         //imagestring($image,$fsize,floor($PieCenterX + $ArcX-5),floor($PieCenterY + $ArcY-5),"中国".$percent."%",$colorBorder);
         //imagettftext ($image,12,0,floor($PieCenterX + $ArcX-5),floor($PieCenterY + $ArcY-5),$colorBorder,'simkai.ttf',$this->NameArray[$i]."(".$percent."%)");
         //画阴影
         if ($StartDegrees >= 0 and $StartDegrees <= 180) {
             if ($EndDegrees <= 180) {
                 for ($k = 1; $k < 15; $k++) {
                     imagearc($image, $PieCenterX, $PieCenterY + $k, $DoubleA, $DoubleB, $StartDegrees, $EndDegrees, $CurrentDarkColor);
                 }
             } else {
                 for ($k = 1; $k < 15; $k++) {
             

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP imagefilter函数代码示例发布时间:2022-05-15
下一篇:
PHP imagefilledrectangle函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap