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


PHP ImageFilledEllipse函数代码示例

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


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

示例1: ComRadar

 public function ComRadar($Coord, $level)
 {
     list($CoordsX, $CoordsY) = map::ss2xy($Coord);
     $x = 1 + ($CoordsY - 1) * $this->tc + round($this->tc / 2);
     $y = 1 + ($CoordsX - 1) * $this->tc + round($this->tc / 2);
     $ray = $level * 20 * $this->tc;
     ImageFilledEllipse($this->im, $x, $y, $ray, $ray, $this->color);
     return $this;
 }
开发者ID:google-code-backups,项目名称:eude,代码行数:9,代码来源:img.class.php

示例2: ImageFilledEllipse

<?php

ImageFilledEllipse($image, $size / 2, $size / 2, $size - 1, $size - 1, $black);
开发者ID:zmwebdev,项目名称:PHPcookbook-code-3ed,代码行数:3,代码来源:arcs5.php

示例3: ImageCreateFromPNG

<?php

//use existing image as a canvas
$myImage = ImageCreateFromPNG("baseimage.png");
//allocate the color white
$white = ImageColorAllocate($myImage, 255, 255, 255);
//draw on the new canvas
ImageFilledEllipse($myImage, 100, 70, 20, 20, $white);
ImageFilledEllipse($myImage, 175, 70, 20, 20, $white);
ImageFilledEllipse($myImage, 250, 70, 20, 20, $white);
//output the image to the browser
header("Content-type: image/png");
ImagePNG($myImage);
//clean up after yourself
ImageDestroy($myImage);
开发者ID:asifameer,项目名称:PMAAiO-code,代码行数:15,代码来源:imagefrombase.php

示例4: switch


//.........这里部分代码省略.........
        $this->_count = $count;

        switch ($this->_direction) {
            case IMAGE_GRAPH_GRAD_HORIZONTAL :
                $width = $this->_count;
                $height = 1;
                break;

            case IMAGE_GRAPH_GRAD_VERTICAL :
                $width = 1;
                $height = $this->_count;
                break;

            case IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED :
                $width = 2 * $this->_count;
                $height = 1;
                break;

            case IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED :
                $width = 1;
                $height = 2 * $this->_count;
                break;

            case IMAGE_GRAPH_GRAD_DIAGONALLY_TL_BR :
            case IMAGE_GRAPH_GRAD_DIAGONALLY_BL_TR :
                $width = $height = $this->_count / 2;
                break;

            case IMAGE_GRAPH_GRAD_RADIAL :
                $width = $height = sqrt($this->_count * $this->_count / 2);
                break;
        }

        if (isset($GLOBALS['_Image_Graph_gd2'])) {
            $this->_image = ImageCreateTrueColor($width, $height);
        } else {
            $this->_image = ImageCreate($width, $height);
        }

        $redIncrement = ($this->_endColor['RED'] - $this->_startColor['RED']) / $this->_count;
        $greenIncrement = ($this->_endColor['GREEN'] - $this->_startColor['GREEN']) / $this->_count;
        $blueIncrement = ($this->_endColor['BLUE'] - $this->_startColor['BLUE']) / $this->_count;

        for ($i = 0; $i <= $this->_count; $i ++) {
            if ($i == 0) {
                $red = $this->_startColor['RED'];
                $green = $this->_startColor['GREEN'];
                $blue = $this->_startColor['BLUE'];
            } else {
                $red = round(($redIncrement * $i) + $redIncrement + $this->_startColor['RED']);
                $green = round(($greenIncrement * $i) + $greenIncrement + $this->_startColor['GREEN']);
                $blue = round(($blueIncrement * $i) + $blueIncrement + $this->_startColor['BLUE']);
            }
            $color = ImageColorAllocate($this->_image, $red, $green, $blue);

            switch ($this->_direction) {
                case IMAGE_GRAPH_GRAD_HORIZONTAL :
                    ImageSetPixel($this->_image, $i, 0, $color);
                    break;

                case IMAGE_GRAPH_GRAD_VERTICAL :
                    ImageSetPixel($this->_image, 0, $height - $i, $color);
                    break;

                case IMAGE_GRAPH_GRAD_HORIZONTAL_MIRRORED :
                    ImageSetPixel($this->_image, $i, 0, $color);
                    ImageSetPixel($this->_image, $width - $i, 0, $color);
                    break;

                case IMAGE_GRAPH_GRAD_VERTICAL_MIRRORED :
                    ImageSetPixel($this->_image, 0, $i, $color);
                    ImageSetPixel($this->_image, 0, $height - $i, $color);
                    break;

                case IMAGE_GRAPH_GRAD_DIAGONALLY_TL_BR :
                    if ($i > $width) {
                        $polygon = array ($width, $i - $width, $width, $height, $i - $width, $height);
                    } else {
                        $polygon = array (0, $i, 0, $height, $width, $height, $width, 0, $i, 0);
                    }
                    ImageFilledPolygon($this->_image, $polygon, count($polygon) / 2, $color);
                    break;

                case IMAGE_GRAPH_GRAD_DIAGONALLY_BL_TR :
                    if ($i > $height) {
                        $polygon = array ($i - $height, 0, $width, 0, $width, 2 * $height - $i);
                    } else {
                        $polygon = array (0, $height - $i, 0, 0, $width, 0, $width, $height, $i, $height);
                    }
                    ImageFilledPolygon($this->_image, $polygon, count($polygon) / 2, $color);
                    break;

                case IMAGE_GRAPH_GRAD_RADIAL :
                    if (($GLOBALS['_Image_Graph_gd2']) and ($i < $this->_count)) {
                        ImageFilledEllipse($this->_image, $width / 2, $height / 2, $this->_count - $i, $this->_count - $i, $color);
                    }
                    break;
            }
        }
    }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:Gradient.php

示例5: ImageCreateTruecolor

<?php

$im = ImageCreateTruecolor(400, 300);
ImageFilledRectangle($im, 0, 0, 399, 299, 0xffffff);
ImageFilledEllipse($im, 200, 150, 300, 300, 0x0);
ImageAlphaBlending($im, true);
ImageFilledRectangle($im, 100, 0, 400, 100, 0x60ff1111);
ImageFilledRectangle($im, 100, 100, 400, 200, 0x30ff1111);
ImageFilledRectangle($im, 100, 200, 400, 300, 0x10ff1111);
Header('Content-Type: image/png');
ImagePNG($im);
开发者ID:SandyS1,项目名称:presentations,代码行数:11,代码来源:image_colors_ex3.php

示例6: header

header("Content-type: image/png");
$width = 100;
$height = 100;
$r = 0;
$g = 0;
$b = 255;
//$alpha = 0;
if (isset($_GET['w'])) {
    $width = $_GET['w'];
}
if (isset($_GET['h'])) {
    $height = $_GET['h'];
}
if (isset($_GET['c'])) {
    $c = $_GET['c'];
    $r = hexdec($c[0] . $c[1]);
    $g = hexdec($c[2] . $c[3]);
    $b = hexdec($c[4] . $c[5]);
}
$im = imagecreatetruecolor($width, $height);
$color = ImageColorAllocate($im, $r, $g, $b);
$white = ImageColorAllocate($im, 255, 255, 255);
imagefilltoborder($im, 0, 0, $white, $white);
imagecolortransparent($im, $white);
$cx = ceil($width / 2);
$cy = ceil($height / 2);
ImageFilledEllipse($im, $cx, $cy, $width - 1, $height - 1, $color);
// send the new PNG image to the browser
imagepng($im);
// destroy the reference pointer to the image in memory to free up resources
imagedestroy($im);
开发者ID:Dirichi,项目名称:Ushahidi_Web,代码行数:31,代码来源:color_icon.php

示例7: substr

$code = substr($rcode, 2, NV_GFX_NUM);
$image = imagecreate(NV_GFX_WIDTH, NV_GFX_HEIGHT);
$bgc = imagecolorallocate($image, 240, 240, 240);
imagefilledrectangle($image, 0, 0, NV_GFX_WIDTH, NV_GFX_HEIGHT, $bgc);
$text_color = ImageColorAllocate($image, 50, 50, 50);
/* output each character */
for ($l = 0; $l < 5; $l++) {
    $r = mt_rand(120, 255);
    $g = mt_rand(120, 255);
    $b = mt_rand(120, 255);
    $color_elipse = ImageColorAllocate($image, round($r * 0.9), round($g * 0.9), round($b * 0.9));
    $cx = mt_rand(0, NV_GFX_WIDTH - NV_GFX_HEIGHT);
    $cy = mt_rand(0, NV_GFX_WIDTH - NV_GFX_HEIGHT);
    $rx = mt_rand(10, NV_GFX_WIDTH - NV_GFX_HEIGHT);
    $ry = mt_rand(10, NV_GFX_WIDTH - NV_GFX_HEIGHT);
    ImageFilledEllipse($image, $cx, $cy, $rx, $ry, $color_elipse);
}
$r = mt_rand(0, 100);
$g = mt_rand(0, 100);
$b = mt_rand(0, 100);
$text_color = ImageColorAllocate($image, $r, $g, $b);
$ff = mt_rand(1, 15);
$font = NV_ROOTDIR . "/includes/fonts/captcha/font" . $ff . ".ttf";
if (file_exists($font) and function_exists('imagettftext')) {
    imagettftext($image, 15, 0, 5, NV_GFX_HEIGHT - 3, $text_color, $font, $code);
} else {
    ImageString($image, 5, 20, 6, $code, $text_color);
}
Header("Content-type: image/jpeg");
header("Cache-Control:");
header("Pragma:");
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:captcha.php

示例8: DrawBubbles

 protected function DrawBubbles()
 {
     if (!$this->CheckDataType('data-data-xyz')) {
         return FALSE;
     }
     $gcvars = array();
     // For GetDataColor, which initializes and uses this.
     // Calculate or use supplied maximum bubble size:
     if (isset($this->bubbles_max_size)) {
         $bubbles_max_size = $this->bubbles_max_size;
     } else {
         $bubbles_max_size = min($this->plot_area_width, $this->plot_area_height) / 12;
     }
     // Calculate bubble scale parameters. Bubble_size(z) = $f_size * $z + $b_size
     if ($this->max_z <= $this->min_z) {
         // Regressive case, no Z range.
         $f_size = 0;
         $b_size = ($bubbles_max_size + $this->bubbles_min_size) / 2;
         // Use average size of all bubbles
     } else {
         $f_size = ($bubbles_max_size - $this->bubbles_min_size) / ($this->max_z - $this->min_z);
         $b_size = $bubbles_max_size - $f_size * $this->max_z;
     }
     for ($row = 0; $row < $this->num_data_rows; $row++) {
         $rec = 1;
         // Skip record #0 (data label)
         $x = $this->xtr($this->data[$row][$rec++]);
         // Get X value from data array.
         // Draw X Data labels?
         if ($this->x_data_label_pos != 'none') {
             $this->DrawXDataLabel($this->data[$row][0], $x, $row, TRUE);
         }
         // Proceed with Y,Z values
         for ($idx = 0; $rec < $this->num_recs[$row]; $rec += 2, $idx++) {
             if (is_numeric($y_now = $this->data[$row][$rec])) {
                 //Allow for missing Y data
                 $y = $this->ytr($y_now);
                 $z = (double) $this->data[$row][$rec + 1];
                 // Z is required if Y is present.
                 $size = (int) ($f_size * $z + $b_size);
                 // Calculate bubble size
                 // Select the color:
                 $this->GetDataColor($row, $idx, $gcvars, $data_color);
                 // Draw the bubble:
                 ImageFilledEllipse($this->img, $x, $y, $size, $size, $data_color);
                 $this->DoCallback('data_points', 'circle', $row, $idx, $x, $y, $size);
             }
         }
     }
     return TRUE;
 }
开发者ID:danorama,项目名称:orsee,代码行数:51,代码来源:class.phplot.php

示例9: dessine_champignons

function dessine_champignons($x, $y, $taille, $pas, $info_text, $tab_couleur, $info, $champignons)
{
    global $db_vue_rm, $image;
    $x_min = $x - $taille / 2;
    $x_max = $x + $taille / 2;
    $y_min = $y - $taille / 2;
    $y_max = $y + $taille / 2;
    $lesChampis = selectDbChampignons($x_min, $x_max, $y_min, $y_max, $champignons);
    $nbChampis = count($lesChampis);
    for ($i = 1; $i <= $nbChampis; $i++) {
        $res = $lesChampis[$i];
        // Si l'on affiche uniquement les champignons que l'on voit
        // on met les couleurs suivant la positions z
        if ($champignons == 'vus') {
            if ($res['z_champi'] == '0') {
                $z = 0;
            } else {
                $z = $res['z_champi'];
            }
            if ($res['z_champi'] < 1) {
                $level = 0;
            } elseif ($res['z_champi'] < 2) {
                $level = 1;
            } else {
                if ($res['z_champi'] < 3) {
                    $level = 2;
                } else {
                    if ($res['z_champi'] < 5) {
                        $level = 3;
                    } else {
                        $level = 4;
                    }
                }
            }
        } else {
            // sinon, on met les couleurs suivant les dates
            $level = 2;
        }
        // Combien vaut x et y pour la map
        $x_map = D + TAILLE_MAP / 2 - $x * $pas + $pas * $res['x_champi'];
        $y_map = D + TAILLE_MAP / 2 + $y * $pas - $pas * $res['y_champi'];
        ImageFilledEllipse($image, $x_map, $y_map, 3, 3, $tab_couleur[$level]);
        // On affiche la position du champignon si la vue est <= 50, soit la taille <=100.
        // et que la taille de la map est >= 400 Sinon, on voit rien
        // c'est devenu une option nommée info_text
        //=> Illisible !
        //if (($taille<=$info_text*2) && (TAILLE_MAP >= 400)) {
        //	imagestring($image, 2, $x_map , $y_map,
        //						'('.$res[x_champi].','.$res[y_champi].','.$res[z_champi].' )', $tab_couleur[0]);
        //}
    }
    affiche_texte_bottom($info . ":" . $nbChampis, $tab_couleur);
}
开发者ID:relaismago,项目名称:outils,代码行数:53,代码来源:gps_advanced_img.php

示例10: ImageCreate

$period = 24 * 3600;
//création du fond de la carte
$im = ImageCreate(2 * $larg + $decall + 60, 2 * $larg + $decalv + 20) or die("Erreur lors de la création de l'image");
$fond = imagecolorallocatealpha($im, 255, 255, 255, 127);
ImageFill($im, 0, 0, $fond);
//couleurs de base
$bleu = ImageColorAllocate($im, 17, 17, 150);
$bleu_c = ImageColorAllocate($im, 100, 117, 200);
for ($i = 1; $i < $nb_pt; $i++) {
    // imageline($im, $coord[2*$i-2]*$coeff+$decall+$larg, -$coord[2*$i-1]*$coeff+$decalv+$larg, $coord[2*$i]*$coeff+$decall+$larg, -$coord[2*$i+1]*$coeff+$decalv+$larg, $bleu_c );
    $dx = $coord[2 * $i] - $coord[2 * $i - 2];
    $dy = $coord[2 * $i + 1] - $coord[2 * $i - 1];
    //Détermination de la forme du trajet
    if (abs($dx) < abs($dy)) {
        $x_inter = $coord[2 * $i];
        $y_inter = $dy < 0 ? $coord[2 * $i - 1] - abs($dx) : $coord[2 * $i - 1] + abs($dx);
    } else {
        $x_inter = $dx > 0 ? $coord[2 * $i - 2] + abs($dy) : $coord[2 * $i - 2] - abs($dy);
        $y_inter = $coord[2 * $i + 1];
    }
    //Affichage des lignes
    imagelinethick($im, $coord[2 * $i - 2] * $coeff + $decall + $larg, -$coord[2 * $i - 1] * $coeff + $decalv + $larg, $x_inter * $coeff + $decall + $larg, -$y_inter * $coeff + $decalv + $larg, $bleu_c, 2);
    imagelinethick($im, $x_inter * $coeff + $decall + $larg, -$y_inter * $coeff + $decalv + $larg, $coord[2 * $i] * $coeff + $decall + $larg, -$coord[2 * $i + 1] * $coeff + $decalv + $larg, $bleu_c, 2);
    //affichage des points
    ImageFilledEllipse($im, $coord[2 * $i] * $coeff + $decall + $larg, -$coord[2 * $i + 1] * $coeff + $decalv + $larg, 6, 6, $bleu_c);
}
ImageFilledEllipse($im, $coord[0] * $coeff + $decall + $larg, -$coord[1] * $coeff + $decalv + $larg, 6, 6, $bleu_c);
ImageColorTransparent($im, $blanc);
//export image
header("Content-type: image/png");
ImagePng($im);
开发者ID:athimel,项目名称:zoryazilla-php,代码行数:31,代码来源:carte_trajet.php

示例11: ImageFilledArc

            if ($row["grain"] > 0) {
                ImageFilledArc($map, $row["x"], $row["y"], 30, 24, 90 - 12 * $row["grain"], 90 + 12 * $row["grain"], $grain, IMG_ARC_PIE);
            }
            // Draw hidden boomer lines
            for ($i = 1; $i <= $row["boomers"]; $i++) {
                ImageEllipse($map, $row["x"], $row["y"], 25 + $i * 4, 19 + $i * 4, $powerc);
            }
            // Draw tank or visible boomer lines
            for ($i = 1; $i <= $row["major"]; $i++) {
                ImageEllipse($map, $row["x"], $row["y"], 25 + ($row['boomers'] + $i) * 4, 19 + ($row['boomers'] + $i) * 4, $black);
            }
            // Draw inner ellipse
            if ($row["colour"] == 'Vuln') {
                ImageFilledEllipse($map, $row["x"], $row["y"], 19, 13, $white);
            } else {
                ImageFilledEllipse($map, $row["x"], $row["y"], 19, 13, $blue);
            }
            // Draw minor units
            if ($row["minor"] > 9) {
                $row["minor"] = '*';
            }
            ImageTTFText($map, 10, 0, $row["x"] - 4, $row["y"] + 5, $black, $font, $row["minor"]);
        }
    }
}
// Finish colouring in
// Add Game number
if ($xsize >= 500) {
    // Get turn and phase
    $result = $mysqli->query("Select Distinct turnno, phaseno From sp_game Where gameno={$gameno}");
    if ($result->num_rows > 0) {
开发者ID:WiiMoritz,项目名称:21.180-commander,代码行数:31,代码来源:map.php

示例12: ImageCreateTrueColor

<?php

$size = 100;
$scale = 2.5;
$image = ImageCreateTrueColor($size * $scale, $size);
$background_color = 0xffffff;
// white
ImageFilledRectangle($image, 0, 0, $size * $scale - 1, $size * $scale - 1, $background_color);
$black = 0x0;
ImageEllipse($image, $size / 2, $size / 2, $size - 1, $size - 1, $black);
ImageFilledEllipse($image, $size / 2 + ($scale - 1) * $size, $size / 2, $size - 1, $size - 1, $black);
header('Content-type: image/png');
ImagePNG($image);
ImageDestroy($image);
开发者ID:zmwebdev,项目名称:PHPcookbook-code-3ed,代码行数:14,代码来源:arcs-circles.php

示例13: hexdec

         $color_text_b = hexdec(substr($CFontColor, 5, 2));
         $color_text = ImageColorAllocate($im, $color_text_r, $color_text_g, $color_text_b);
         break;
 }
 $noiset = mt_rand(1, 2);
 if ($CBackgroundType == 1) {
     switch ($noiset) {
         case '1':
             /* make the random background elipses */
             for ($l = 0; $l < 10; $l++) {
                 $c = 'color_elipse' . $l % 2;
                 $cx = mt_rand(0, $image_width);
                 $cy = mt_rand(0, $image_width);
                 $rx = mt_rand(10, $image_width);
                 $ry = mt_rand(10, $image_width);
                 ImageFilledEllipse($im, $cx, $cy, $rx, $ry, ${$c});
             }
             break;
         case '2':
             /* make the random background lines */
             for ($l = 0; $l < 10; $l++) {
                 $c = 'color_line' . $l % 2;
                 $lx = mt_rand(0, $image_width + $image_height);
                 $lw = mt_rand(0, 3);
                 if ($lx > $image_width) {
                     $lx -= $image_width;
                     ImageFilledRectangle($im, 0, $lx, $image_width - 1, $lx + $lw, $c);
                 } else {
                     ImageFilledRectangle($im, $lx, 0, $lx + $lw, $image_height - 1, $c);
                 }
             }
开发者ID:haibocu,项目名称:ShoppingWebsite,代码行数:31,代码来源:code.php

示例14: array

$h_opts = array(1 => 'left', 0 => 'center', -1 => 'right');
$cx = $width / 2;
$cy = $height / 2;
$x_off = $height / 4.0;
$y_off = $width / 4.0;
# Because we don't let PHPlot finish drawing, we need to set the background.
imagefilledrectangle($img, 0, 0, $width, $height, $white);
if (isset($tp['line_spacing'])) {
    $p->SetLineSpacing($tp['line_spacing']);
}
# Draw a title:
ImageString($img, '3', 5, 5, $title, $black);
# This is the rest of the text after the first line:
$addl_lines = '';
$addl_text = '';
for ($i = 2; $i <= $nlines; $i++) {
    $addl_lines .= "\nLine {$i}" . $addl_text;
    $addl_text .= " E";
}
# Loop over all text alignment cases:
foreach ($v_opts as $v_step => $v) {
    foreach ($h_opts as $h_step => $h) {
        $text = "[{$h}, {$v}]" . $addl_lines;
        $x = $cx + $h_step * $x_off;
        $y = $cy + $v_step * $y_off;
        $p->DrawText($font, $angle, $x, $y, $blue, $text, $h, $v);
        ImageFilledEllipse($img, $x, $y, 8, 8, $red);
    }
}
# Don't have PHPlot output a graph: just do it ourselves:
imagepng($img);
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:drawtext.php

示例15: drawshape

 private function drawshape($image, $action, $color)
 {
     switch ($action % 7) {
         case 0:
             ImageFilledRectangle($image, $this->getX(), $this->getY(), $this->getX(), $this->getY(), $color);
             break;
         case 1:
         case 2:
             ImageFilledEllipse($image, $this->getX(), $this->getY(), $this->getX(), $this->getY(), $color);
             break;
         case 3:
             $points = array($this->getX(), $this->getY(), $this->getX(), $this->getY(), $this->getX(), $this->getY(), $this->getX(), $this->getY());
             ImageFilledPolygon($image, $points, 4, $color);
             break;
         case 4:
         case 5:
         case 6:
             $start = $this->getInt() * 360 / 256;
             $end = $start + $this->getInt() * 180 / 256;
             ImageFilledArc($image, $this->getX(), $this->getY(), $this->getX(), $this->getY(), $start, $end, $color, IMG_ARC_PIE);
             break;
     }
 }
开发者ID:nichdu,项目名称:ZeroBin,代码行数:23,代码来源:vizhash_gd_zero.php


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