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

PHP imagefilledpolygon函数代码示例

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

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



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

示例1: draw

 /**
  * draw point on map
  *
  * @param Map $map
  */
 public function draw(Map $map)
 {
     parent::draw($map);
     $point = $map->getPixelPointFromCoordinates($this->getLon(), $this->getLat());
     $vertices = array($point['x'], $point['y'], $point['x'] - 10, $point['y'] - 20, $point['x'] + 10, $point['y'] - 20);
     imagefilledpolygon($map->getImage(), $vertices, 3, imagecolorallocate($map->getImage(), 200, 0, 0));
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:12,代码来源:MarkPoint.php


示例2: CreatePolygon

 function CreatePolygon($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, ((geometria.x - medidas.xinicial)/medidas.factor) x, ({$ancho} - ((geometria.y - medidas.yinicial)/medidas.factor)) y \n        FROM \n           (SELECT gid, st_x((ST_DumpPoints(geom)).geom) x, st_y((ST_DumpPoints(geom)).geom) y \n            FROM \n               (SELECT gid, tab.{$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                ) s \n           ) geometria,\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";
     $result = pg_query($conn, $query) or die("Error al ejecutar la consulta");
     $gid = '';
     $pointPolygonArray = array();
     while ($row = pg_fetch_row($result)) {
         if ($gid == '') {
             $gid = $row[0];
             array_push($pointPolygonArray, $row[1], $row[2]);
         } else {
             if ($gid == $row[0]) {
                 array_push($pointPolygonArray, $row[1], $row[2]);
             } else {
                 imagefilledpolygon($imagen, $pointPolygonArray, count($pointPolygonArray) / 2, $color);
                 $pointPolygonArray = array();
                 $gid = $row[0];
                 array_push($pointPolygonArray, $row[1], $row[2]);
             }
         }
     }
     imagefilledpolygon($imagen, $pointPolygonArray, count($pointPolygonArray) / 2, $color);
     return $imagen;
 }
开发者ID:fauricioRojas,项目名称:MultiVisorMapas,代码行数:30,代码来源:graficos.php


示例3: getCodeColorImage

 /**
  * 获得彩色的验证码图片
  * @param array $paramArr 
  */
 public static function getCodeColorImage($paramArr)
 {
     $options = array('width' => 80, 'height' => 30, 'numCnt' => 4, 'inCode' => 'ABCD');
     if (is_array($paramArr)) {
         $options = array_merge($options, $paramArr);
     }
     extract($options);
     $img = imagecreate($width, $height);
     $bgcolor = self::getRandColor($img, 200);
     //背景色
     $fontCnt = 6;
     $numCnt = 4;
     $authCode = self::getAuthCode($inCode);
     for ($i = 0; $i < $numCnt; $i++) {
         $padding_left = rand(5, 10);
         $left = $padding_left + ($width - 10) * $i / $numCnt;
         //加入多边形色块干扰
         imagefilledpolygon($img, array(rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height), rand($left, $left + 20), rand(0, $height)), 10, self::getRandColor($img, 180));
         $fontFile = SYSTEM_VAR . 'fonts/' . rand(1, $fontCnt) . '.ttf';
         imagettftext($img, rand(18, 24), rand(-30, 30), $left, rand(22, 26), self::getRandColor($img, 0, 120), $fontFile, $authCode[$i]);
     }
     //干扰像素,随机位置,随机颜色
     for ($i = 0; $i < 300; $i++) {
         $rand_x = rand(0, $width - 1);
         $rand_y = rand(0, $height - 1);
         imagesetpixel($img, $rand_x, $rand_y, self::getRandColor($img));
     }
     header("Content-type:image/png");
     imagepng($img);
     imagedestroy($img);
     exit;
 }
开发者ID:dalinhuang,项目名称:andyou,代码行数:36,代码来源:CheckCode.php


示例4: genterate_flag

function genterate_flag($hex)
{
    $r = hexdec(substr($hex, 0, 2));
    $g = hexdec(substr($hex, 2, 2));
    $b = hexdec(substr($hex, 4, 2));
    // create a true colour, transparent image
    // turn blending OFF and draw a background rectangle in our transparent colour
    $default_size = 30;
    $size = $_REQUEST["size"];
    if ($size == '') {
        $size = $default_size;
    }
    $iwidth = $size;
    $iheight = $size;
    $image = imagecreatetruecolor($iwidth, $iheight);
    //
    imagealphablending($image, false);
    $col = imagecolorallocatealpha($image, 255, 255, 255, 127);
    $newc = imagecolorallocate($image, $r, $g, $b);
    $black = imagecolorallocatealpha($image, 0, 0, 0, 50);
    imagefilledrectangle($image, 0, 0, $iwidth, $iheight, $col);
    //imagefilledrectangle($image,10,10,($iwidth -10) ,($iheight-10),$newc);
    $values = array(0, $size / 10, 0, $size / 2, $size / 2, $size, $size, $size / 2, $size / 2, 0, $size / 10, 0);
    imagefilledpolygon($image, $values, 6, $newc);
    //imagefilledellipse($image, $size / 5, $size / 5 , $size / 8 , $size / 8, $black);
    imagefilledellipse($image, $size / 5, $size / 5, $size / 6, $size / 6, $col);
    //imagefilledpolygon($image , $values , 4 , $col );
    // imagealphablending($image,true);
    // ^^ Alpha blanding is back on.
    // insert image manipulation stuff in here
    // output the results...
    imagealphablending($image, true);
    // imagesavealpha($image,true);
    return $image;
}
开发者ID:name256,项目名称:crm42,代码行数:35,代码来源:image.flag.php


示例5: add

 /**
  * Add method
  *
  * @return void Redirects on successful add, renders view otherwise.
  */
 public function add()
 {
     $mask = $this->Masks->newEntity();
     if ($this->request->is('post')) {
         $mask = $this->Masks->patchEntity($mask, $this->request->data);
         if ($this->Masks->save($mask)) {
             //draw thumbnail
             $virtualimage = imagecreate(100, 100);
             $fillcolor = imagecolorallocate($virtualimage, 0, 0, 0);
             $bg = imagecolorallocate($virtualimage, 239, 239, 239);
             imagefilledrectangle($virtualimage, 0, 0, 100, 100, $bg);
             $points = explode(",", $this->request->data['polygon']);
             foreach ($points as $key => $point) {
                 $points[$key] = (int) ((double) trim($point) * 100);
             }
             imagefilledpolygon($virtualimage, $points, count($points) / 2, $fillcolor);
             if (imagejpeg($virtualimage, WWW_ROOT . 'img' . DS . 'maskthumbs' . DS . $mask->id . '.jpg')) {
                 $this->Flash->success(__('The mask has been saved.'));
                 return $this->redirect(['action' => 'index']);
             } else {
                 $this->Flash->error(__('The mask thumbnail could not be created. Please, try again.'));
             }
         } else {
             $this->Flash->error(__('The mask could not be saved. Please, try again.'));
         }
     }
     $this->set(compact('mask'));
     $this->set('_serialize', ['mask']);
 }
开发者ID:bobombolo,项目名称:fotomucker,代码行数:34,代码来源:MasksController.php


示例6: draw_axises

function draw_axises($im_width, $im_height)
{
    global $im, $black, $l_grey, $x0, $y0, $maxX, $maxY, $minX, $minY, $red;
    global $string_x_start, $string_x_end, $string_y_start, $string_y_end;
    global $im, $black, $l_grey, $x0, $y0, $maxX, $maxY, $startX, $startY, $minX, $minY;
    $maxX = $im_width - 25.0;
    $maxY = $im_height - 20.0;
    $minY = $maxY - $minY - 20.0;
    imageline($im, 25.0, $minY + 20.0, $maxX, $minY + 20.0, $black);
    imageline($im, $minX + 25.0, 20.0, $minX + 25.0, $maxY, $black);
    $xArrow[0] = $maxX - 6;
    $xArrow[1] = $minY + 20 - 2;
    $xArrow[2] = $maxX;
    $xArrow[3] = $minY + 20;
    $xArrow[4] = $maxX - 6;
    $xArrow[5] = $minY + 20 + 2;
    imagefilledpolygon($im, $xArrow, 3, $black);
    $yArrow[0] = $minX + 25 - 2;
    $yArrow[1] = 20 + 6;
    $yArrow[2] = $minX + 25;
    $yArrow[3] = 20;
    $yArrow[4] = $minX + 25 + 2;
    $yArrow[5] = 20 + 6;
    imagefilledpolygon($im, $yArrow, 3, $black);
    imagestring($im, 2, 25.0, $minY + 20.0, $string_x_start, $black);
    imagestring($im, 2, $maxX, $minY + 20.0, $string_x_end, $black);
    imagestring($im, 2, $minX + 15.0, 20.0, $string_y_end, $black);
}
开发者ID:mpospelov,项目名称:fedoruk_php,代码行数:28,代码来源:grafic.php


示例7: draw_axises

function draw_axises($im_width, $im_heignt)
{
    global $im, $black, $l_grey, $x0, $y0, $maxX, $maxY, $minXVal, $minYVal;
    $x0 = 25.0;
    //начало оси координат по X
    $y0 = 20.0;
    //начало оси координат по Y
    $maxX = $im_width - $x0;
    //максимальное значение оси координат по X в пикселах
    $maxY = $im_heignt - $y0;
    //максимальное значение оси координат по Y в пикселах
    imageline($im, $x0, $maxY, $maxX + 5, $maxY, $black);
    //рисуем ось X
    imageline($im, $x0, $y0 - 5, $x0, $maxY, $black);
    //рисуем ось Y
    //рисуем стрелку на оси X
    $xArrow[0] = $maxX + 2;
    $xArrow[1] = $maxY - 2;
    $xArrow[2] = $maxX + 8;
    $xArrow[3] = $maxY;
    $xArrow[4] = $maxX + 2;
    $xArrow[5] = $maxY + 2;
    imagefilledpolygon($im, $xArrow, 3, $black);
    //рисуем стрелку на оси Y
    $yArrow[0] = $x0 - 2;
    $yArrow[1] = $y0 - 2;
    $yArrow[2] = $x0;
    $yArrow[3] = $y0 - 8;
    $yArrow[4] = $x0 + 2;
    $yArrow[5] = $y0 - 2;
    imagefilledpolygon($im, $yArrow, 3, $black);
}
开发者ID:Atiragram,项目名称:poit-labs,代码行数:32,代码来源:image-graph.php


示例8: _drawLine

 private function _drawLine($image, $x1, $y1, $x2, $y2)
 {
     $thick = $this->_thickness->getThickness();
     $color = $this->_getDrawColor($image);
     if ($thick == 1) {
         return imageline($image, $x1, $y1, $x2, $y2, $color);
     }
     if ($this->hasTransparency() && $this->_transparency->getTransparency() != ParamTransparency::$minAlpha) {
         $t = $thick / 2 - 0.5;
         if ($x1 == $x2 || $y1 == $y2) {
             return imagefilledrectangle($image, round(min($x1, $x2) - $t), round(min($y1, $y2) - $t), round(max($x1, $x2) + $t), round(max($y1, $y2) + $t), $color);
         }
         $k = ($y2 - $y1) / ($x2 - $x1);
         //y = kx + q
         $a = $t / sqrt(1 + pow($k, 2));
         $points = array(round($x1 - (1 + $k) * $a), round($y1 + (1 - $k) * $a), round($x1 - (1 - $k) * $a), round($y1 - (1 + $k) * $a), round($x2 + (1 + $k) * $a), round($y2 - (1 - $k) * $a), round($x2 + (1 - $k) * $a), round($y2 + (1 + $k) * $a));
         imagefilledpolygon($image, $points, 4, $color);
         imagepolygon($image, $points, 4, $color);
     } else {
         imagesetthickness($image, $thick);
         imageline($image, $x1, $y1, $x2, $y2, $color);
         imagesetthickness($image, 1);
         imagefilledellipse($image, $x1, $y1, $thick, $thick, $color);
         imagefilledellipse($image, $x2, $y2, $thick, $thick, $color);
         imageellipse($image, $x1, $y1, $thick, $thick, $color);
         imageellipse($image, $x2, $y2, $thick, $thick, $color);
     }
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:28,代码来源:Line.php


示例9: showImage

 /**
  * renders the current captcha image
  */
 function showImage()
 {
     $image = imagecreatetruecolor($this->width, $this->height);
     $width = imagesx($image);
     $height = imagesy($image);
     $black = imagecolorallocate($image, 0, 0, 0);
     $white = imagecolorallocate($image, 250, 250, 250);
     $red = imagecolorallocatealpha($image, 225, 225, 225, 75);
     $green = imagecolorallocatealpha($image, 150, 150, 150, 75);
     $blue = imagecolorallocatealpha($image, 200, 200, 200, 75);
     imagefilledrectangle($image, 0, 0, $width, $height, $white);
     imagefilledellipse($image, ceil(rand(5, 145)), ceil(rand(0, 35)), 30, 30, $red);
     $points = array(rand(0, 150), rand(0, 50), rand(0, 150), rand(0, 50), rand(0, 150), rand(0, 50), rand(0, 150), rand(0, 50), rand(0, 150), rand(0, 50), rand(0, 150), rand(0, 50));
     imagefilledpolygon($image, $points, 4, $blue);
     imagefilledpolygon($image, array_reverse($points), 6, $green);
     imagefilledrectangle($image, 0, 0, $width, 0, $black);
     imagefilledrectangle($image, $width - 1, 0, $width - 1, $height - 1, $black);
     imagefilledrectangle($image, 0, 0, 0, $height - 1, $black);
     imagefilledrectangle($image, 0, $height - 1, $width, $height - 1, $black);
     for ($i = 0; $i < 50; $i++) {
         //imagefilledrectangle($im, $i + $i2, 5, $i + $i3, 70, $black);
         imagesetthickness($image, rand(1, 5));
         imagearc($image, rand(1, 150), rand(1, 50), rand(1, 150), rand(1, 50), rand(1, 150), rand(1, 50), rand(0, 1) ? $green : $red);
     }
     if (function_exists("imagettftext")) {
         $font = DIR_ROOT . 'view/fonts/Duality.ttf';
         imagettftext($image, 24, rand(-5, 5), intval(($width - strlen($this->code) * 10) / 2), intval(($height + 10) / 2), $black, $font, $this->code);
     } else {
         imagestring($image, 5, intval(($width - strlen($this->code) * 9) / 2), intval(($height - 15) / 2), $this->code, $black);
     }
     header('Content-type: image/jpeg');
     imagejpeg($image);
     imagedestroy($image);
 }
开发者ID:phpsa,项目名称:CoreCMS,代码行数:37,代码来源:captcha.php


示例10: leftPointer

 function leftPointer($image, $xpoint, $ypoint, $colour)
 {
     $black = imagecolorallocate($image, 0x0, 0x0, 0x0);
     $values = array($xpoint + 13, $ypoint - 1, $xpoint + 10, $ypoint - 1, $xpoint + 10, $ypoint - 5, $xpoint + 3, $ypoint + 2, $xpoint + 10, $ypoint + 9, $xpoint + 10, $ypoint + 5, $xpoint + 13, $ypoint + 5);
     imagefilledpolygon($image, $values, 7, $colour);
     imagepolygon($image, $values, 7, $black);
 }
开发者ID:RoneilZA,项目名称:dashboards,代码行数:7,代码来源:maxgraphdrawer.php


示例11: diagonalCross

 public function diagonalCross($img, $width, $height, $backColour, $crossColour)
 {
     $smallest = min($width, $height);
     //Make the width of the lines 20% of the smallest
     $lineWidth = $smallest * 0.2;
     $halfLine = $lineWidth / 2;
     //Draw the polygons in the background colour instead of drawing the lines, as when the lines overlap, the opacity changes in the overlap space
     $topPolyPointX = $width / 2;
     $topPolyPointY = $height / 2 - $halfLine;
     $topPolyEndX = $width - $halfLine;
     $bottomPolyPointX = $width / 2;
     $bottomPolyPointY = $height / 2 + $halfLine;
     $bottomPolyEndX = $width - $halfLine;
     $leftPolyPointX = $width / 2 - $halfLine;
     $leftPolyPointY = $height / 2;
     $leftPolyEndY = $height - $halfLine;
     $rightPolyPointX = $width / 2 + $halfLine;
     $rightPolyPointY = $height / 2;
     $rightPolyEndY = $height - $halfLine;
     imagefilledrectangle($img, 0, 0, $width, $height, $crossColour);
     imagefilledpolygon($img, array($halfLine, 0, $topPolyPointX, $topPolyPointY, $topPolyEndX, 0), 3, $backColour);
     imagefilledpolygon($img, array($halfLine, $height, $bottomPolyPointX, $bottomPolyPointY, $bottomPolyEndX, $height), 3, $backColour);
     imagefilledpolygon($img, array(0, $halfLine, $leftPolyPointX, $leftPolyPointY, 0, $leftPolyEndY), 3, $backColour);
     imagefilledpolygon($img, array($width, $halfLine, $rightPolyPointX, $rightPolyPointY, $width, $rightPolyEndY), 3, $backColour);
     return $img;
 }
开发者ID:xcgpseud,项目名称:flag,代码行数:26,代码来源:FlagStyle.php


示例12: draw

 /**
  * Draws this object onto an image
  *
  * @param   img.Image image
  * @return  var
  */
 public function draw($image)
 {
     if ($this->fill) {
         return imagefilledpolygon($image->handle, $this->points, sizeof($this->points) / 2, $this->col->handle);
     } else {
         return imagepolygon($image->handle, $this->points, sizeof($this->points) / 2, $this->col->handle);
     }
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:14,代码来源:Polygon.class.php


示例13: fill

 function fill($transform, $image, $color)
 {
     $coords = $this->getPointArray();
     $size = $this->getPointCount();
     for ($i = 0; $i < $size; $i++) {
         $transform->apply($coords[$i * 2], $coords[$i * 2 + 1]);
     }
     imagefilledpolygon($image, $coords, $size, $color);
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:9,代码来源:path.php


示例14: renderFill

 protected function renderFill($image, array $params, $color)
 {
     if ($params['numpoints'] < 3) {
         return;
     }
     // somehow imagesetthickness() affects the polygon drawing. reset to 0.
     imagesetthickness($image, 0);
     imagefilledpolygon($image, $params['points'], $params['numpoints'], $color);
 }
开发者ID:JangoBrick,项目名称:php-svg,代码行数:9,代码来源:SVGPolygonRenderer.php


示例15: generate

 public function generate()
 {
     $color = $this->hex2dec($this->color);
     $im = imagecreate($this->size, $this->size);
     imagefill($im, 0, 0, imagecolorallocate($im, $this->bgColorRGB[0], $this->bgColorRGB[1], $this->bgColorRGB[2]));
     $color = imagecolorallocate($im, $color[0], $color[1], $color[2]);
     imagefilledpolygon($im, array($this->size / 2, 0, $this->size, $this->size / 2, $this->size / 2, $this->size, 0, $this->size / 2), 4, $color);
     $this->image = $im;
     $this->markerSize = $this->size / 1.01;
     return $im;
 }
开发者ID:gdbhosale,项目名称:fancy-qr-code-generator,代码行数:11,代码来源:QrTagDotSquare5.php


示例16: applyToResource

 /**
  * Draw polygon on given GD resource
  *
  * @param  resource $resource
  * @param  integer  $x
  * @param  interger $y
  * @return boolean
  */
 private function applyToResource($resource, $x, $y)
 {
     $background = new Color($this->background);
     imagefilledpolygon($resource, $this->points, intval(count($this->points) / 2), $background->getInt());
     if ($this->hasBorder()) {
         $border_color = new Color($this->border_color);
         imagesetthickness($resource, $this->border_width);
         imagepolygon($resource, $this->points, intval(count($this->points) / 2), $border_color->getInt());
     }
     return true;
 }
开发者ID:EdgarPost,项目名称:image,代码行数:19,代码来源:PolygonShape.php


示例17: draw

 private function draw()
 {
     $image = imagecreatetruecolor($this->size, $this->size);
     imagealphablending($image, true);
     imagefilledrectangle($image, 0, 0, $this->size, $this->size, imagecolorallocatealpha($image, 0, 0, 0, 0));
     foreach ($this->polygons as $polygon) {
         $color = imagecolorallocatealpha($image, $polygon[0], $polygon[0], $polygon[0], $polygon[1]);
         imagefilledpolygon($image, array_slice($polygon, 2), count($polygon) / 2 - 1, $color);
     }
     return $image;
 }
开发者ID:bencoder,项目名称:PhpImageGa,代码行数:11,代码来源:run.php


示例18: show_gd_img

function show_gd_img($content = "")
{
    $content = '  ' . preg_replace("/(\\w)/", "\\1 ", $content) . ' ';
    $gd_version = 2;
    @header("Content-Type: image/jpeg");
    $tmp_x = 140;
    $tmp_y = 20;
    $image_x = 210;
    $image_y = 65;
    $circles = 3;
    if ($gd_version == 1) {
        $tmp = imagecreate($tmp_x, $tmp_y);
        $im = imagecreate($image_x, $image_y);
    } else {
        $tmp = imagecreatetruecolor($tmp_x, $tmp_y);
        $im = imagecreatetruecolor($image_x, $image_y);
    }
    $white = ImageColorAllocate($tmp, 255, 255, 255);
    $black = ImageColorAllocate($tmp, 0, 0, 0);
    $grey = ImageColorAllocate($tmp, 210, 210, 210);
    imagefill($tmp, 0, 0, $white);
    for ($i = 1; $i <= $circles; $i++) {
        $values = array(0 => rand(0, $tmp_x - 10), 1 => rand(0, $tmp_y - 3), 2 => rand(0, $tmp_x - 10), 3 => rand(0, $tmp_y - 3), 4 => rand(0, $tmp_x - 10), 5 => rand(0, $tmp_y - 3), 6 => rand(0, $tmp_x - 10), 7 => rand(0, $tmp_y - 3), 8 => rand(0, $tmp_x - 10), 9 => rand(0, $tmp_y - 3), 10 => rand(0, $tmp_x - 10), 11 => rand(0, $tmp_y - 3));
        $randomcolor = imagecolorallocate($tmp, rand(100, 255), rand(100, 255), rand(100, 255));
        imagefilledpolygon($tmp, $values, 6, $randomcolor);
    }
    imagestring($tmp, 5, 0, 2, $content, $black);
    //-----------------------------------------
    // Distort by resizing
    //-----------------------------------------
    imagecopyresized($im, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y);
    imagedestroy($tmp);
    $white = ImageColorAllocate($im, 255, 255, 255);
    $black = ImageColorAllocate($im, 0, 0, 0);
    $grey = ImageColorAllocate($im, 100, 100, 100);
    $random_pixels = $image_x * $image_y / 10;
    for ($i = 0; $i < $random_pixels; $i++) {
        ImageSetPixel($im, rand(0, $image_x), rand(0, $image_y), $black);
    }
    $no_x_lines = ($image_x - 1) / 5;
    for ($i = 0; $i <= $no_x_lines; $i++) {
        // X lines
        ImageLine($im, $i * $no_x_lines, 0, $i * $no_x_lines, $image_y, $grey);
        // Diag lines
        ImageLine($im, $i * $no_x_lines, 0, $i * $no_x_lines + $no_x_lines, $image_y, $grey);
    }
    $no_y_lines = ($image_y - 1) / 5;
    for ($i = 0; $i <= $no_y_lines; $i++) {
        ImageLine($im, 0, $i * $no_y_lines, $image_x, $i * $no_y_lines, $grey);
    }
    ImageJPEG($im);
    ImageDestroy($im);
    exit;
}
开发者ID:CHEZDESIGN,项目名称:mytorrent,代码行数:54,代码来源:GD_Security_image.php


示例19: applyToImage

 /**
  * Draw polygon on given image
  *
  * @param  Image   $image
  * @param  integer $x
  * @param  integer $y
  * @return boolean
  */
 public function applyToImage(Image $image, $x = 0, $y = 0)
 {
     $background = new Color($this->background);
     imagefilledpolygon($image->getCore(), $this->points, intval(count($this->points) / 2), $background->getInt());
     if ($this->hasBorder()) {
         $border_color = new Color($this->border_color);
         imagesetthickness($image->getCore(), $this->border_width);
         imagepolygon($image->getCore(), $this->points, intval(count($this->points) / 2), $border_color->getInt());
     }
     return true;
 }
开发者ID:hilmysyarif,项目名称:sic,代码行数:19,代码来源:PolygonShape.php


示例20: drawAxis

 public function drawAxis($vImage, $vColor, $iPosX = 0, $iPosY = false)
 {
     if ($iPosY === false) {
         $iPosY = imagesy($vImage);
     }
     $vImageWidth = imagesx($vImage);
     imageline($vImage, $iPosX, $iPosY, $iPosX, 0, $vColor);
     imageline($vImage, $iPosX, $iPosY, $vImageWidth, $iPosY, $vColor);
     imagefilledpolygon($vImage, array($iPosX, 0, $iPosX - 3, 5, $iPosX + 3, 5), 3, $vColor);
     imagefilledpolygon($vImage, array($vImageWidth, $iPosY, $vImageWidth - 5, $iPosY - 3, $vImageWidth - 5, $iPosY + 3), 3, $vColor);
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:11,代码来源:Plot.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP imagefilledrectangle函数代码示例发布时间:2022-05-15
下一篇:
PHP imagefilledellipse函数代码示例发布时间: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