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


PHP imagearc函数代码示例

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


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

示例1: create

 /** 创建验证码 */
 public function create()
 {
     // 创建图象
     $this->_img_res = imagecreate($this->width, $this->height);
     // 填充背景
     ImageColorAllocate($this->_img_res, $this->backgroundColor[0], $this->backgroundColor[1], $this->backgroundColor[2]);
     // 分配颜色
     $col_ellipse = imagecolorallocate($this->_img_res, $this->iconColor[0], $this->iconColor[1], $this->iconColor[2]);
     $minArea = $this->iconSize / 2 + 3;
     // 混淆用图象,不完整的圆
     for ($i = 0; $i < $this->icon; $i++) {
         $x = mt_rand($minArea, $this->width - $minArea);
         $y = mt_rand($minArea, $this->height - $minArea);
         $s = mt_rand(0, 360);
         $e = $s + 330;
         imagearc($this->_img_res, $x, $y, $this->iconSize, $this->iconSize, $s, $e, $col_ellipse);
     }
     // 验证用图象,完整的圆
     $x = mt_rand($minArea, $this->width - $minArea);
     $y = mt_rand($minArea, $this->height - $minArea);
     $r = $this->iconSize / 2;
     imagearc($this->_img_res, $x, $y, $this->iconSize, $this->iconSize, 0, 360, $col_ellipse);
     // 记录圆心坐标及半径
     $this->captcha_session($this->sess_name, array($x, $y, $r));
     // 生成图象
     Header("Content-type: image/PNG");
     ImagePNG($this->_img_res);
     ImageDestroy($this->_img_res);
     exit;
 }
开发者ID:Birjemin,项目名称:Study,代码行数:31,代码来源:ClickCaptcha.class.php

示例2: vCode

function vCode($num = 4, $size = 20, $width = 0, $height = 0)
{
    !$width && ($width = $num * $size * 4 / 5 + 5);
    !$height && ($height = $size + 10);
    $str = "0123456789";
    //验证码字符全集
    $code = '';
    for ($i = 0; $i < $num; $i++) {
        $code .= $str[mt_rand(0, strlen($str) - 1)];
    }
    // 画图像
    $im = imagecreatetruecolor($width, $height);
    // 定义要用到的颜色
    $back_color = imagecolorallocate($im, 255, 255, 255);
    //    $boer_color = imagecolorallocate($im, 100, 100, 100);
    $text_color = imagecolorallocate($im, 50, 50, 50);
    // 画背景
    imagefilledrectangle($im, 0, 0, $width, $height, $back_color);
    // 画边框
    //    imagerectangle($im, 0, 0, $width-1, $height-1, $boer_color);
    // 画干扰线
    for ($i = 0; $i < 30; $i++) {
        $font_color = imagecolorallocate($im, 0, 0, 0);
        imagearc($im, mt_rand(-$width, $width), mt_rand(-$height, $height), mt_rand(30, $width * 2), mt_rand(20, $height * 2), mt_rand(0, 360), mt_rand(0, 360), $font_color);
    }
    // 画验证码
    @imagefttext($im, $size, 0, 5, $size + 3, $text_color, 'images/index/Callie-Mae.ttf', $code);
    $_SESSION["VerifyCode"] = $code;
    header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");
    header("Content-type: image/png;charset=gb2312");
    imagepng($im);
    imagedestroy($im);
}
开发者ID:xiaoshizhishijingsai,项目名称:2014,代码行数:33,代码来源:identify.php

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

示例4: gauge

 function gauge()
 {
     // Prepare image
     $this->img = imagecreate(100, 100);
     $this->white = imagecolorallocate($this->img, 255, 255, 255);
     $this->black = imagecolorallocate($this->img, 0, 0, 0);
     $this->red = imagecolorallocate($this->img, 150, 0, 0);
     $this->yellow = imagecolorallocate($this->img, 150, 150, 0);
     $this->green = imagecolorallocate($this->img, 0, 150, 0);
     // Set parameters
     $this->center = 50;
     $this->min = 0;
     $this->maxred = 50;
     $this->maxyellow = 80;
     $this->max = 100;
     $this->pos = 90;
     $this->legend = "";
     // Draw Gauge
     imagearc($this->img, $this->center, $this->center, 100, 100, 0, 360, $this->black);
     imagearc($this->img, $this->center, $this->center, 10, 10, 0, 360, $this->black);
     imagearc($this->img, $this->center, $this->center, 86, 86, 0 + 180, 180 + 180, $this->black);
     imagearc($this->img, $this->center, $this->center, 56, 56, 0 + 180, 180 + 180, $this->black);
     $this->addLine($this->min);
     $this->addLine($this->maxred);
     imagefill($this->img, 25, 25, $this->red);
     //check this point if you move the arcs
     $this->addLine($this->maxyellow);
     imagefill($this->img, 55, 15, $this->yellow);
     //check this point if you move the arcs
     $this->addLine($this->max);
     imagefill($this->img, 85, 30, $this->green);
     //check this point if you move the arcs
     imagefill($this->img, 50, 75, $this->black);
 }
开发者ID:SuichiesS,项目名称:homewatch,代码行数:34,代码来源:gauge.class.php

示例5: fill_arc

 public static function fill_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $color2, $text = '', $placeindex = 0)
 {
     $r = $diameter / 2;
     $w = deg2rad((360 + $start + ($end - $start) / 2) % 360);
     if (function_exists("imagefilledarc")) {
         // exists only if GD 2.0.1 is avaliable
         imagefilledarc($im, $centerX + 1, $centerY + 1, $diameter, $diameter, $start, $end, $color1, IMG_ARC_PIE);
         imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2, IMG_ARC_PIE);
         imagefilledarc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color1, IMG_ARC_NOFILL | IMG_ARC_EDGED);
     } else {
         imagearc($im, $centerX, $centerY, $diameter, $diameter, $start, $end, $color2);
         imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
         imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($start + 1)) * $r, $centerY + sin(deg2rad($start)) * $r, $color2);
         imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end - 1)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
         imageline($im, $centerX, $centerY, $centerX + cos(deg2rad($end)) * $r, $centerY + sin(deg2rad($end)) * $r, $color2);
         imagefill($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $color2);
     }
     if ($text) {
         if ($placeindex > 0) {
             imageline($im, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $diameter, $placeindex * 12, $color1);
             imagestring($im, 4, $diameter, $placeindex * 12, $text, $color1);
         } else {
             imagestring($im, 4, $centerX + $r * cos($w) / 2, $centerY + $r * sin($w) / 2, $text, $color1);
         }
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:26,代码来源:APCImages.php

示例6: draw_axes

function draw_axes()
{
    global $im, $black, $gray;
    for ($x = -1.1; $x <= 1.1; $x += 0.2) {
        imagearc($im, transform_x($x), transform_y(y), 3, 3, 0, 360, $black);
        imagettftext($im, 10, 0, transform_x($x) - 10, transform_y(0) - 4, $black, FONT, $x);
        for ($y = 0; $y <= HEIGHT; $y += 30) {
            imageline($im, transform_x($x), $y, transform_x($x), $y + 10, $gray);
        }
        imagearc($im, transform_x($x), transform_y(f($x)), 3, 3, 0, 360, $black);
        for ($xprime = 0; $xprime <= transform_x($x); $xprime += 30) {
            imageline($im, $xprime, transform_y(f($x)), $xprime + 10, transform_y(f($x)), $gray);
        }
        imagettftext($im, 10, 0, transform_x($x) + 4, transform_y(f($x)), $black, FONT, round(f($x), 2));
    }
    // x axis
    imageline($im, 0, HEIGHT / 2, WIDTH, HEIGHT / 2, $black);
    // y axis
    imageline($im, WIDTH / 2, 0, WIDTH / 2, HEIGHT, $black);
    // box
    imageline($im, 0, 0, WIDTH, 0, $black);
    imageline($im, 0, 0, 0, HEIGHT, $black);
    imageline($im, 0, HEIGHT - 1, WIDTH - 1, HEIGHT - 1, $black);
    imageline($im, WIDTH - 1, 0, WIDTH - 1, HEIGHT - 1, $black);
}
开发者ID:Hepic,项目名称:web-class,代码行数:25,代码来源:plot.php

示例7: gd_rectangle

/**
 * GD Rectangle Function
 *
 * @param class $siggen
 * @param array $data
 * 		int x
 * 		int y
 * 		int x2
 * 		int y2
 * 		bool filled
 * 		int radius
 * 		string color
 * 		int alpha
 *
 * @return bool
 */
function gd_rectangle($siggen, $data)
{
    // Get our color index
    $color = $this->set_color($data['color'], $data['alpha']);
    // Make sure radius is a positive number
    $data['radius'] = abs($data['radius']);
    // Only do this "massive" drawing if we have rounded corners
    if ($data['radius'] > 0) {
        if ($data['filled'] == 1) {
            imagefilledrectangle($siggen->im, $data['x'] + $data['radius'], $data['y'], $data['x2'] - $data['radius'], $data['y2'], $color);
            imagefilledrectangle($siggen->im, $data['x'], $data['y'] + $data['radius'], $data['x'] + $data['radius'] - 1, $data['y2'] - $data['radius'], $color);
            imagefilledrectangle($siggen->im, $data['x2'] - $data['radius'] + 1, $data['y'] + $data['radius'], $data['x2'], $data['y2'] - $data['radius'], $color);
            imagefilledarc($siggen->im, $data['x'] + $data['radius'], $data['y'] + $data['radius'], $data['radius'] * 2, $data['radius'] * 2, 180, 270, $color, IMG_ARC_PIE);
            imagefilledarc($siggen->im, $data['x2'] - $data['radius'], $data['y'] + $data['radius'], $data['radius'] * 2, $data['radius'] * 2, 270, 360, $color, IMG_ARC_PIE);
            imagefilledarc($siggen->im, $data['x'] + $data['radius'], $data['y2'] - $data['radius'], $data['radius'] * 2, $data['radius'] * 2, 90, 180, $color, IMG_ARC_PIE);
            imagefilledarc($siggen->im, $data['x2'] - $data['radius'], $data['y2'] - $data['radius'], $data['radius'] * 2, $data['radius'] * 2, 360, 90, $color, IMG_ARC_PIE);
        } else {
            imageline($siggen->im, $data['x'] + $data['radius'], $data['y'], $data['x2'] - $data['radius'], $data['y'], $color);
            imageline($siggen->im, $data['x'] + $data['radius'], $data['y2'], $data['x2'] - $data['radius'], $data['y2'], $color);
            imageline($siggen->im, $data['x'], $data['y'] + $data['radius'], $data['x'], $data['y2'] - $data['radius'], $color);
            imageline($siggen->im, $data['x2'], $data['y'] + $data['radius'], $data['x2'], $data['y2'] - $data['radius'], $color);
            imagearc($siggen->im, $data['x'] + $data['radius'], $data['y'] + $data['radius'], $data['radius'] * 2, $data['radius'] * 2, 180, 270, $color);
            imagearc($siggen->im, $data['x2'] - $data['radius'], $data['y'] + $data['radius'], $data['radius'] * 2, $data['radius'] * 2, 270, 360, $color);
            imagearc($siggen->im, $data['x'] + $data['radius'], $data['y2'] - $data['radius'], $data['radius'] * 2, $data['radius'] * 2, 90, 180, $color);
            imagearc($siggen->im, $data['x2'] - $data['radius'], $data['y2'] - $data['radius'], $data['radius'] * 2, $data['radius'] * 2, 360, 90, $color);
        }
    } else {
        if ($data['filled'] == 1) {
            imagefilledrectangle($siggen->im, $data['x'], $data['y'], $data['x2'], $data['y2'], $color);
        } else {
            imagerectangle($siggen->im, $data['x'], $data['y'], $data['x2'], $data['y2'], $color);
        }
    }
    return TRUE;
}
开发者ID:Sajaki,项目名称:addons,代码行数:51,代码来源:gd_rectangle.php

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

示例9: createimage

 function createimage()
 {
     $this->calculate();
     $r = $this->radius;
     //$image=imagecreate($r*3,$r*2); // Modified by Elpidio Latorilla 2003-04-23
     $image = imagecreate($r * 2, $r * 2);
     $white = imagecolorallocate($image, 255, 255, 255);
     $black = imagecolorallocate($image, 0, 0, 0);
     imagecolorTransparent($image, $white);
     for ($k = 0; $k < count($this->colors); $k++) {
         $fillcolor[$k] = imagecolorallocate($image, $this->colornames[$this->colors[$k]][0], $this->colornames[$this->colors[$k]][1], $this->colornames[$this->colors[$k]][2]);
     }
     imagearc($image, $r, $r, $r * 2 - 1, $r * 2 - 1, 0, 360, $black);
     imagefill($image, $r, $r, $fillcolor[0]);
     for ($j = 0; $j < count($this->elements); $j++) {
         $degree += 360 * $this->fractions[$j];
         if ($this->elements[$j]) {
             imageline($image, $r, $r, $r + $r * cos($degree * pi() / 180), $r + $r * sin($degree * pi() / 180), $black);
             imagefill($image, $r + 15 * cos(($degree + 5) * pi() / 180), $r + 15 * sin(($degree + 5) * pi() / 180), $fillcolor[$j]);
         }
         // Modified by Elpidio Latorilla 2003-04-23
         //imagefilledrectangle($image,2.1*$r,.7*$r+($r/15)*$j,2.12*$r+($r/25),.7*$r+5+($r/15)*$j,$fillcolor[$j]);
         //imagestring($image,0,2.13*$r+$r/20,.71*$r+($r/15)*$j-2,$this->elements[$j]."-".$this->elementnames[$j],$black);
     }
     $this->final = $image;
 }
开发者ID:patmark,项目名称:care2x-tz,代码行数:26,代码来源:piechart.class.php

示例10: buildImageVerify

 /**
  * 
  * @brief 图片处理 验证码
  * @param unknown_type $length
  * @param unknown_type $mode
  * @param unknown_type $type
  * @param unknown_type $width
  * @param unknown_type $height
  * @param unknown_type $verifyName
  */
 public static function buildImageVerify($length = 4, $mode = 1, $type = 'png', $width = 48, $height = 22, $verifyName = 'verify')
 {
     $randval = self::randString($length, $mode);
     $_SESSION[$verifyName] = md5($randval);
     $width = $length * 10 + 10 > $width ? $length * 10 + 10 : $width;
     if ($type != 'gif' && function_exists('imagecreatetruecolor')) {
         $im = imagecreatetruecolor($width, $height);
     } else {
         $im = imagecreate($width, $height);
     }
     $r = array(225, 255, 255, 223);
     $g = array(225, 236, 237, 255);
     $b = array(225, 236, 166, 125);
     $key = mt_rand(0, 3);
     $backColor = imagecolorallocate($im, $r[$key], $g[$key], $b[$key]);
     //背景色(随机)
     $borderColor = imagecolorallocate($im, 100, 100, 100);
     //边框色
     imagefilledrectangle($im, 0, 0, $width - 1, $height - 1, $backColor);
     imagerectangle($im, 0, 0, $width - 1, $height - 1, $borderColor);
     $stringColor = imagecolorallocate($im, mt_rand(0, 200), mt_rand(0, 120), mt_rand(0, 120));
     // 干扰
     for ($i = 0; $i < 10; $i++) {
         imagearc($im, mt_rand(-10, $width), mt_rand(-10, $height), mt_rand(200, 300), mt_rand(35, 200), 55, 44, $stringColor);
     }
     for ($i = 0; $i < 25; $i++) {
         imagesetpixel($im, mt_rand(0, $width), mt_rand(0, $height), $stringColor);
     }
     for ($i = 0; $i < $length; $i++) {
         imagestring($im, 5, $i * 10 + 5, mt_rand(1, 8), $randval[$i], $stringColor);
     }
     Image::output($im, $type);
 }
开发者ID:fengxiangyun,项目名称:diary,代码行数:43,代码来源:Image.class.php

示例11: create_captcha

 /**
  * +----------------------------------------------------------
  * 图片上传的处理函数
  * +----------------------------------------------------------
  */
 function create_captcha()
 {
     $word = $this->create_word();
     // 把验证码字符串写入session
     $_SESSION['captcha'] = md5($word . DOU_SHELL);
     // 绘制基本框架
     $im = imagecreatetruecolor($this->captcha_width, $this->captcha_height);
     $bg_color = imagecolorallocate($im, 235, 236, 237);
     imagefilledrectangle($im, 0, 0, $this->captcha_width, $this->captcha_height, $bg_color);
     $border_color = imagecolorallocate($im, 118, 151, 199);
     imagerectangle($im, 0, 0, $this->captcha_width - 1, $this->captcha_height - 1, $border_color);
     // 添加干扰
     for ($i = 0; $i < 5; $i++) {
         $rand_color = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
         imagearc($im, mt_rand(-$this->captcha_width, $this->captcha_width), mt_rand(-$this->captcha_height, $this->captcha_height), mt_rand(30, $this->captcha_width * 2), mt_rand(20, $this->captcha_height * 2), mt_rand(0, 360), mt_rand(0, 360), $rand_color);
     }
     for ($i = 0; $i < 50; $i++) {
         $rand_color = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
         imagesetpixel($im, mt_rand(0, $this->captcha_width), mt_rand(0, $this->captcha_height), $rand_color);
     }
     // 生成验证码图片
     $text_color = imagecolorallocate($im, mt_rand(0, 200), mt_rand(0, 120), mt_rand(0, 120));
     imagestring($im, 6, 18, 5, $word, $text_color);
     // header
     header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");
     header("Content-type: image/png;charset=utf-8");
     /* 绘图结束 */
     imagepng($im);
     imagedestroy($im);
     return true;
 }
开发者ID:phphonor,项目名称:companycms,代码行数:36,代码来源:captcha.class.php

示例12: arc

 /**
  * (non-PHPdoc)
  * @see Imagine\Draw\DrawerInterface::arc()
  */
 public function arc(PointInterface $center, BoxInterface $size, $start, $end, Color $color)
 {
     if (false === imagearc($this->resource, $center->getX(), $center->getY(), $size->getWidth(), $size->getHeight(), $start, $end, $this->getColor($color))) {
         throw new RuntimeException('Draw arc operation failed');
     }
     return $this;
 }
开发者ID:nicodmf,项目名称:Imagine,代码行数:11,代码来源:Drawer.php

示例13: buildVerifyImage

 public static function buildVerifyImage($length = 4, $width = 48, $height = 22, $verifyName = 'verify')
 {
     $randval = substr(md5(time() . microtime()), 5, $length);
     header('Content-Type: image/gif');
     $_SESSION[$verifyName] = md5($randval);
     $width = $length * 9 + 10 > $width ? $length * 9 + 10 : $width;
     $im = @imagecreate($width, $height);
     $r = array(225, 255, 255, 223);
     $g = array(225, 236, 237, 255);
     $b = array(225, 236, 166, 125);
     $key = mt_rand(0, 3);
     $backColor = imagecolorallocate($im, $r[$key], $g[$key], $b[$key]);
     //背景色(随机)
     $borderColor = imagecolorallocate($im, 100, 100, 100);
     //边框色
     $pointColor = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
     //点颜色
     @imagefilledrectangle($im, 0, 0, $width - 1, $height - 1, $backColor);
     //@imagerectangle($im, 0, 0, $width-1, $height-1, $borderColor);
     $stringColor = imagecolorallocate($im, mt_rand(0, 200), mt_rand(0, 120), mt_rand(0, 120));
     //干扰
     for ($i = 0; $i < 5; $i++) {
         $fontcolor = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
         imagearc($im, mt_rand(-10, $width), mt_rand(-10, $height), mt_rand(30, 300), mt_rand(20, 200), 55, 44, $fontcolor);
     }
     for ($i = 0; $i < 10; $i++) {
         $fontcolor = imagecolorallocate($im, mt_rand(0, 255), mt_rand(0, 255), mt_rand(0, 255));
         imagesetpixel($im, mt_rand(0, $width), mt_rand(0, $height), $pointColor);
     }
     @imagestring($im, 5, 5, 3, $randval, $stringColor);
     imagegif($im);
 }
开发者ID:princehaku,项目名称:flowphp,代码行数:32,代码来源:Image.class.php

示例14: draw

 /**
  * Draws this object onto an image
  *
  * @param   img.Image image
  * @return  var
  */
 public function draw($image)
 {
     if (FALSE !== $this->fill) {
         return imagefilledarc($image->handle, $this->cx, $this->cy, $this->w, $this->h, $this->s, $this->e, $this->col->handle, $this->fill);
     } else {
         return imagearc($image->handle, $this->cx, $this->cy, $this->w, $this->h, $this->s, $this->e, $this->col->handle);
     }
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:14,代码来源:Arc.class.php

示例15: draw_data

	function draw_data($x,$y,$rad,$color, $isCore = false)
	{
		global $im,$x0,$y0,$black, $maxX, $maxY;
		
		//рисуем точку
		imagefilledarc($im,$x0 + $x,$maxY-$y,$rad,$rad,0,360,$color,IMG_ARC_PIE);
		if ($isCore) imagearc($im,$x0 + $x,$maxY-$y,$rad,$rad,0,360,$black);
	}
开发者ID:Atiragram,项目名称:poit-labs,代码行数:8,代码来源:image-2.php


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