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

PHP imagesetthickness函数代码示例

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

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



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

示例1: render

 /**
  * Outputs the Captcha image.
  *
  * @param   boolean  html output
  * @return  mixed
  */
 public function render($html)
 {
     // Creates a black image to start from
     $this->image_create(Captcha::$config['background']);
     // Add random white/gray arcs, amount depends on complexity setting
     $count = (Captcha::$config['width'] + Captcha::$config['height']) / 2;
     $count = $count / 5 * min(10, Captcha::$config['complexity']);
     for ($i = 0; $i < $count; $i++) {
         imagesetthickness($this->image, mt_rand(1, 2));
         $color = imagecolorallocatealpha($this->image, 255, 255, 255, mt_rand(0, 120));
         imagearc($this->image, mt_rand(-Captcha::$config['width'], Captcha::$config['width']), mt_rand(-Captcha::$config['height'], Captcha::$config['height']), mt_rand(-Captcha::$config['width'], Captcha::$config['width']), mt_rand(-Captcha::$config['height'], Captcha::$config['height']), mt_rand(0, 360), mt_rand(0, 360), $color);
     }
     // Use different fonts if available
     $font = Captcha::$config['fontpath'] . Captcha::$config['fonts'][array_rand(Captcha::$config['fonts'])];
     // Draw the character's white shadows
     $size = (int) min(Captcha::$config['height'] / 2, Captcha::$config['width'] * 0.8 / strlen($this->response));
     $angle = mt_rand(-15 + strlen($this->response), 15 - strlen($this->response));
     $x = mt_rand(1, Captcha::$config['width'] * 0.9 - $size * strlen($this->response));
     $y = (Captcha::$config['height'] - $size) / 2 + $size;
     $color = imagecolorallocate($this->image, 255, 255, 255);
     imagefttext($this->image, $size, $angle, $x + 1, $y + 1, $color, $font, $this->response);
     // Add more shadows for lower complexities
     Captcha::$config['complexity'] < 10 and imagefttext($this->image, $size, $angle, $x - 1, $y - 1, $color, $font, $this->response);
     Captcha::$config['complexity'] < 8 and imagefttext($this->image, $size, $angle, $x - 2, $y + 2, $color, $font, $this->response);
     Captcha::$config['complexity'] < 6 and imagefttext($this->image, $size, $angle, $x + 2, $y - 2, $color, $font, $this->response);
     Captcha::$config['complexity'] < 4 and imagefttext($this->image, $size, $angle, $x + 3, $y + 3, $color, $font, $this->response);
     Captcha::$config['complexity'] < 2 and imagefttext($this->image, $size, $angle, $x - 3, $y - 3, $color, $font, $this->response);
     // Finally draw the foreground characters
     $color = imagecolorallocate($this->image, 0, 0, 0);
     imagefttext($this->image, $size, $angle, $x, $y, $color, $font, $this->response);
     // Output
     return $this->image_render($html);
 }
开发者ID:momoim,项目名称:momo-api,代码行数:39,代码来源:Black.php


示例2: apply

 public function apply($resource)
 {
     // Extract arguments
     @(list(, $x1, $y1, $x2, $y2, $thickness, $color) = func_get_args());
     $x1 = (int) $x1;
     $y1 = (int) $y1;
     $x2 = (int) $x2;
     $y2 = (int) $y2;
     $thickness = (int) $thickness;
     if (!$color) {
         $color = '#000000';
     }
     $rgb = html2rgb($color);
     if ($thickness < 1) {
         $thickness = 1;
     }
     // Draw line
     if (!imagesetthickness($resource, $thickness)) {
         throw new Exception("Thickness line changing failed");
     }
     if (!imageline($resource, $x1, $y1, $x2, $y2, imagecolorallocate($resource, $rgb[0], $rgb[1], $rgb[2]))) {
         throw new Exception("Line drawing failed");
     }
     return $resource;
 }
开发者ID:pyrsmk,项目名称:imagix,代码行数:25,代码来源:Line.php


示例3: _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


示例4: check

function check($len = 4)
{
    session_start();
    header('content-type:image/png');
    $fs = ['/a.ttf', '/b.ttf', '/f.ttf'];
    $font = dirname(__FILE__) . $fs[mt_rand(0, 1)];
    $w = 35 * $len;
    $h = 50;
    $i = imagecreatetruecolor($w, $h);
    $c = imagecolorallocatealpha($i, 0, 0, 0, 127);
    //imagecolortransparent($i,$c);
    //imagefill($i,0,0,$c);
    imagefilledrectangle($i, 0, 0, $w, $h, gc($i, 'ffffff', mt_rand(0, 2)));
    $sss = '';
    for ($j = 0; $j < $len; $j++) {
        $st = gs(1);
        $sss .= $st;
        imagettftext($i, mt_rand(15, 25), mt_rand(-30, 30), $j * 35 + 10, mt_rand(28, 38), gc($i), $font, $st);
    }
    $_SESSION['code'] = $sss;
    imagesetthickness($i, mt_rand(2, 8));
    for ($j = 0; $j < mt_rand(5, 10); $j++) {
        imagefilledarc($i, mt_rand(0, $w), mt_rand(0, $h), mt_rand(0, $w), mt_rand(0, $h), mt_rand(0, 360), mt_rand(0, 360), gc($i, 'rand', mt_rand(100, 120)), IMG_ARC_NOFILL);
    }
    for ($j = 0; $j < 10; $j++) {
        imagettftext($i, mt_rand(10, 15), mt_rand(-5, 5), mt_rand(0, $w), mt_rand(0, $h), gc($i, 'rand', mt_rand(100, 120)), $font, gs(1));
    }
    imagepng($i);
    imagedestroy($i);
}
开发者ID:lsunny,项目名称:henanshichang,代码行数:30,代码来源:i.php


示例5: makeGraphicalCaptcha

 /**
  * Makes a graphical captcha from the provided text string
  *
  * @param string $captcha_text string to make image captcha from
  * @return string $data_url a data url containing the obfuscated image
  */
 function makeGraphicalCaptcha($captcha_text)
 {
     $image = @imagecreatetruecolor(195, 35);
     // defines background color, random lines color and text color
     $bg_color = imagecolorallocate($image, mt_rand(0, 255), 255, 0);
     imagefill($image, 0, 0, $bg_color);
     $lines_color = imagecolorallocate($image, 0x99, 0xcc, 0x99);
     $text_color = imagecolorallocate($image, mt_rand(0, 255), 0, 255);
     // draws random lines
     for ($i = 0; $i < 4; $i++) {
         imageline($image, 0, rand(0, 35), 195, rand(0, 35), $lines_color);
     }
     $captcha_letter_array = str_split($captcha_text);
     foreach ($captcha_letter_array as $i => $captcha_letter) {
         imagesetthickness($image, 1);
         imagestring($image, 5, 5 + $i * 35, rand(2, 14), $captcha_letter, $text_color);
     }
     // creates image
     ob_start();
     imagejpeg($image);
     $image_data = ob_get_contents();
     ob_end_clean();
     $data_url = "data:image/jpeg;base64," . base64_encode($image_data);
     imagedestroy($image);
     return $data_url;
 }
开发者ID:yakar,项目名称:yioop,代码行数:32,代码来源:captcha_model.php


示例6: 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


示例7: creat_line

 private function creat_line()
 {
     imagesetthickness($this->img, 3);
     $xpos = $this->size * 2 + rand(-5, 5);
     $width = $this->width / 2.66 + rand(3, 10);
     $height = $this->size * 2.14;
     if (rand(0, 100) % 2 == 0) {
         $start = rand(0, 66);
         $ypos = $this->height / 2 - rand(10, 30);
         $xpos += rand(5, 15);
     } else {
         $start = rand(180, 246);
         $ypos = $this->height / 2 + rand(10, 30);
     }
     $end = $start + rand(75, 110);
     imagearc($this->img, $xpos, $ypos, $width, $height, $start, $end, $this->color);
     if (rand(1, 75) % 2 == 0) {
         $start = rand(45, 111);
         $ypos = $this->height / 2 - rand(10, 30);
         $xpos += rand(5, 15);
     } else {
         $start = rand(200, 250);
         $ypos = $this->height / 2 + rand(10, 30);
     }
     $end = $start + rand(75, 100);
     imagearc($this->img, $this->width * 0.75, $ypos, $width, $height, $start, $end, $this->color);
 }
开发者ID:iquanxin,项目名称:march,代码行数:27,代码来源:vcode.cls.php


示例8: drawLine

function drawLine()
{
    //header('Content-type: image/png');
    $png_image = imagecreate(150, 150);
    imagecolorallocate($png_image, 15, 142, 210);
    imagesetthickness($png_image, 5);
    $black = imagecolorallocate($png_image, 0, 0, 0);
    $x = 0;
    $y = 0;
    $w = imagesx($png_image) - 1;
    $z = imagesy($png_image) - 1;
    // Rectangle
    // imageline ($image, $x1, $y1, $x2, $y2, $color)
    imageline($png_image, $x, $y, $x, $y + $z, $black);
    imageline($png_image, $x, $y, $x + $w, $y, $black);
    imageline($png_image, $x + $w, $y, $x + $w, $y + $z, $black);
    imageline($png_image, $x, $y + $z, $x + $w, $y + $z, $black);
    // Lines
    imageline($png_image, $x, $y, $w, $z, $black);
    imagepng($png_image, 'simpletext.png');
    //imagepng($png_image);
    imagedestroy($png_image);
    $imgNumber = new NumberImage(1, 50, 50, 10);
    $imgNumber->setFileName("jedan");
    $imgNumber->drawNumberLineImage();
}
开发者ID:skoja,项目名称:TroDoFer,代码行数:26,代码来源:drawLine.php


示例9: generate_image

 function generate_image($canvas)
 {
     global $captcha_font_path, $captcha_img_path;
     imagesetthickness($canvas, 1);
     //$rand = preg_replace("/([0-9])/e","chr((\\1+112))",rand(100000,999999));
     $var = rand(0, 1);
     $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
     $liney = rand(3, 6);
     $linex = rand(6, 12);
     for ($i = $liney; $i > 0; $i--) {
         $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
         //	if ($i==0)
         //	{
         //	$this->arrow($canvas,10,$i*60/$liney,200,$i*60/$liney, 5, 5, $color );
         //	}
         //     else
         //     {
         imageline($canvas, 10, $i * 60 / $liney, 200, $i * 60 / $liney, $color);
         //    }
         imagefttext($canvas, 8, rand(-45, 45), 3, $i * 60 / $liney, $color, $captcha_font_path . "/LiberationMono-Bold.ttf", $liney - $i);
         $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
     }
     for ($i = 0; $i < $linex; $i++) {
         $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
         imageline($canvas, 30 + $i * 160 / $linex, 0, 30 + $i * 160 / $linex, 70, $color);
         $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
         imagefttext($canvas, 8, rand(-45, 45), 30 + $i * 160 / $linex, 80, $color, $captcha_font_path . "/LiberationMono-Bold.ttf", $i);
         $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
     }
     $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
     imagesetthickness($canvas, 1);
     $x = rand(0, $linex - 1);
     $y = rand(0, $liney - 1);
     for ($i = -5; $i < 5; $i++) {
         $xr = rand(0, $linex);
         $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
         $yr = rand(0, $liney);
         imageline($canvas, 30 + $x * 160 / $linex, ($liney - $y) * 60 / $liney, 30 + $xr * 160 / $linex, ($liney - $yr) * 60 / $liney, $color);
     }
     $color = imagecolorallocate($canvas, rand(100, 255), rand(100, 255), rand(100, 255));
     //echo "!".$x."===".$y."!<br>";
     if ($var) {
         imagefttext($canvas, 20, rand(-45, 45), 40 + 20, 50, $color, $captcha_font_path . "/LiberationMono-Bold.ttf", "y=?");
     } else {
         imagefttext($canvas, 12, rand(-45, 45), 100, 70, $color, $captcha_font_path . "/LiberationMono-Bold.ttf", "X=?");
     }
     $nme = $this->ucaptcha->get_filename();
     imagepng($canvas);
     //imagepng($canvas,$captcha_img_path."/".$nme.".png");
     $captcha[0] = $nme;
     if ($var) {
         $captcha[1] = $y;
         $captcha[2] = "Введите координату Y точки, откуда берут начало прямые";
     } else {
         $captcha[1] = $x;
         $captcha[2] = "Введите координату X точки, откуда берут начало прямые";
     }
     return $captcha;
 }
开发者ID:vladimir-g,项目名称:rulinux-engine,代码行数:59,代码来源:plugin.php


示例10: drawLines

 private function drawLines()
 {
     $lineCnt = mt_rand(4, 8);
     for ($i = 0; $i < $lineCnt; $i++) {
         imagesetthickness($this->tmpImage, rand(1, 3));
         imagearc($this->tmpImage, mt_rand(-10, $this->width), mt_rand(-10, $this->height), mt_rand(30, 300), mt_rand(20, 200), mt_rand(80, 360), mt_rand(0, 300), $this->textColor);
     }
 }
开发者ID:tsoftware-org,项目名称:captcha,代码行数:8,代码来源:Captcha.php


示例11: draw

 /**
  * {@inheritdoc}
  */
 public final function draw(CanvasInterface $canvas, StyleInterface $style = null)
 {
     if (!$canvas->isHandlerSet()) {
         throw new CanvasEmptyException(sprintf('Can Not Draw Drawable (%s) - Canvas Is Empty', (string) $this));
     }
     @imagesetthickness($canvas->getHandler(), $this->getLineThickness());
     $this->doDraw($canvas, $style);
     return $this;
 }
开发者ID:El-Loco-Pinguino,项目名称:FaitesUnVoeu_WF3,代码行数:12,代码来源:AbstractStyledDrawable.php


示例12: renderStroke

 protected function renderStroke($image, array $params, $color, $strokeWidth)
 {
     imagesetthickness($image, $strokeWidth);
     if ($params['open']) {
         $this->renderStrokeOpen($image, $params['points'], $color);
         return;
     }
     imagepolygon($image, $params['points'], $params['numpoints'], $color);
 }
开发者ID:JangoBrick,项目名称:php-svg,代码行数:9,代码来源:SVGPolygonRenderer.php


示例13: randsquare

 private function randsquare()
 {
     imagesetthickness($this->image, 1);
     srand($this->make_seed());
     $x = rand(0, $this->larguaImagem - 15);
     $y = rand(0, $this->alturaImagem - 15);
     imageFilledRectangle($this->image, $x, $y, $x + 10, $y + 10, $this->color($this->corRetangulos));
     imagerectangle($this->image, $x - 10, $y, $x + 10, $y + 10, $this->randcolor());
 }
开发者ID:vortexacm,项目名称:acmback,代码行数:9,代码来源:class.captcha.php


示例14: drawPolygon

 /**
  * Draw polygon.
  * 
  * @param array $points An array containing the polygon's vertices.
  * @param null|array $options
  */
 public function drawPolygon(array $points, array $options = null)
 {
     $this->setOptions($options);
     $colorRgb = Utility::htmlToRgb($this->optionStrokeColor);
     $color = $this->allocateColor($this->Resource, $colorRgb['r'], $colorRgb['g'], $colorRgb['b']);
     imagesetthickness($this->Resource, $this->optionStrokeWidth);
     $numPoints = count($points) / 2;
     imagepolygon($this->Resource, $points, $numPoints, $color);
 }
开发者ID:kunjara,项目名称:jyotish-draw,代码行数:15,代码来源:Image.php


示例15: __construct

 public function __construct($width, $height)
 {
     // create a GD image to display results and debug
     $this->width = $width;
     $this->height = $height;
     $this->image = imagecreatetruecolor($width, $height);
     $white = imagecolorallocate($this->image, 0xff, 0xff, 0xff);
     imagefill($this->image, 0, 0, $white);
     imagesetthickness($this->image, 3);
 }
开发者ID:jaredballou,项目名称:insurgency-tools-old,代码行数:10,代码来源:PolygonMaker.php


示例16: store_map

function store_map($im, $passthru, $shape, $row, $col, $x1, $y1, $x2, $y2)
{
    static $color = NULL;
    if (!isset($color)) {
        $color = imagecolorallocate($im, 255, 0, 0);
    }
    imagesetthickness($im, 3);
    imagerectangle($im, $x1, $y1, $x2, $y2, $color);
    imagesetthickness($im, 1);
}
开发者ID:myfarms,项目名称:PHPlot,代码行数:10,代码来源:imagemap_trace-bx.php


示例17: make_cut_image

function make_cut_image($row, $verts, $width, $height)
{
    $center = new vertex(0, 0, 0);
    $image = imagecreatetruecolor($width, $height);
    if (isset($_REQUEST['usealpha'])) {
        $trans_color = imagecolorallocatealpha($image, 255, 255, 255, 0);
        imagefill($image, 0, 0, $trans_color);
    }
    $verticies = explode("\n", $verts);
    $start = new vertex(0, 0, 0);
    $start->parse_llvector($verticies[0]);
    $count = count($verticies);
    $x = 0.0;
    $t = 0.0;
    $start_color = new vertex(0, 128, 0);
    $end_color = new vertex(255, 255, 255);
    $previous = $start;
    foreach ($verticies as $point) {
        $current = new vertex(0, 0, 0);
        $current->parse_llvector($point);
        $center->add($current);
        ++$x;
    }
    $center->mult(1.0 / $x);
    $x = 0;
    imagesetthickness($image, 2);
    foreach ($verticies as $point) {
        $t = $x / $count;
        $current = new vertex(0, 0, 0);
        $current->parse_llvector($point);
        if ($verticies[0] != $point) {
            $vcolor = $start_color->get_interp($end_color, $t);
            $color = $vcolor->allocate_color($image);
            fill_pie($image, $center, $previous, $current, $width, $height, $color);
        }
        $previous = $current;
        ++$x;
    }
    $color = imagecolorallocate($image, $end_color->x, $end_color->y, $end_color->z);
    fill_pie($image, $center, $previous, $start, $width, $height, $color);
    $x = 0;
    foreach ($verticies as $point) {
        ++$x;
        $t = $x / $count;
        $current = new vertex(0, 0, 0);
        $current->parse_llvector($point);
        $current->x = ($current->x + 1) * 0.5;
        $current->y = 1.0 - ($current->y + 1) * 0.5;
        $current->x *= $width;
        $current->y *= $height;
        $color = $color = imagecolorallocate($image, 255 * $t, 0, 255 * (1 - $t));
        imagefilledellipse($image, intval($current->x), intval($current->y), 8, 8, $color);
    }
    return $image;
}
开发者ID:BGCX067,项目名称:falados-secondlife-svn-to-git,代码行数:55,代码来源:vertex2cut.inc.php


示例18: applyToImage

 /**
  * Draw rectangle to given image at certain position
  *
  * @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);
     imagefilledrectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $background->getInt());
     if ($this->hasBorder()) {
         $border_color = new Color($this->border_color);
         imagesetthickness($image->getCore(), $this->border_width);
         imagerectangle($image->getCore(), $this->x1, $this->y1, $this->x2, $this->y2, $border_color->getInt());
     }
     return true;
 }
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:19,代码来源:RectangleShape.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: applyToResource

 /**
  * Draw rectangle to given GD resource
  *
  * @param  resource $resource
  * @param  integer  $x
  * @param  integer  $y
  * @return boolean
  */
 private function applyToResource($resource, $x, $y)
 {
     $background = new Color($this->background);
     imagefilledrectangle($resource, $this->x1, $this->y1, $this->x2, $this->y2, $background->getInt());
     if ($this->hasBorder()) {
         $border_color = new Color($this->border_color);
         imagesetthickness($resource, $this->border_width);
         imagerectangle($resource, $this->x1, $this->y1, $this->x2, $this->y2, $border_color->getInt());
     }
     return true;
 }
开发者ID:EdgarPost,项目名称:image,代码行数:19,代码来源:RectangleShape.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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