当前位置: 首页>>代码示例>>PHP>>正文


PHP imagefilltoborder函数代码示例

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


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


注:本文中的imagefilltoborder函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。