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

PHP imageSmoothArc函数代码示例

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

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



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

示例1: generate

 public function generate()
 {
     $color = $this->hex2dec($this->color);
     $color[] = 0;
     $tmp = imagecreatetruecolor($this->size, $this->size);
     imagefill($tmp, 0, 0, imagecolorallocatealpha($tmp, 0, 0, 0, 127));
     imageSmoothArc($tmp, $this->size / 2, $this->size / 2, $this->size * 0.7, $this->size * 0.7, $color, 0, M_PI * 2);
     return $tmp;
 }
开发者ID:gdbhosale,项目名称:fancy-qr-code-generator,代码行数:9,代码来源:QrTagDotLineH.php


示例2: generate

 public function generate()
 {
     $color = $this->hex2dec($this->color);
     $color[] = 0;
     $tmp = imagecreatetruecolor($this->size, $this->size);
     imagefill($tmp, 0, 0, imagecolorallocatealpha($tmp, $this->bgColorRGB[0], $this->bgColorRGB[1], $this->bgColorRGB[2], 127));
     imageSmoothArc($tmp, $this->size / 2, $this->size / 2, $this->size * 0.7, $this->size * 0.7, $color, 0, M_PI * 2);
     $frame = $this->generateMarkerFrame($tmp, false);
     return $frame;
 }
开发者ID:gdbhosale,项目名称:fancy-qr-code-generator,代码行数:10,代码来源:QrTagFrameCircle.php


示例3: generate

 public function generate()
 {
     $color = $this->hex2dec($this->color);
     $color[] = 0;
     $bgColorRGB = $this->bgColorRGB;
     $bgColorRGB[] = 0;
     $tmp = imagecreatetruecolor($this->size * 7.5, $this->size * 7.5);
     imagefill($tmp, 0, 0, imagecolorallocatealpha($tmp, 0, 0, 0, 127));
     imageSmoothArc($tmp, $this->size * 7.5 / 2, $this->size * 7.5 / 2, $this->size * 6.8, $this->size * 6.8, $color, 0, M_PI * 2);
     imageSmoothArc($tmp, $this->size * 7.5 / 2, $this->size * 7.5 / 2, $this->size * 7.5 * 0.7, $this->size * 7.5 * 0.7, $bgColorRGB, 0, M_PI * 2);
     return $tmp;
 }
开发者ID:gdbhosale,项目名称:fancy-qr-code-generator,代码行数:12,代码来源:QrTagFrameCircle2.php


示例4: generate

 public function generate()
 {
     $color = $this->hex2dec($this->color);
     $color[] = 0;
     $im = imagecreatetruecolor($this->size * 3.35, $this->size * 3.35);
     imagefill($im, 0, 0, imagecolorallocatealpha($im, $color[0], $color[1], $color[2], 127));
     $dotSize = 1.7;
     $movePerct = 0.5;
     imageSmoothArc($im, $this->size * 3.35 / 2, $this->size * 3.35 / 2 - $this->size * $dotSize * ($movePerct - 0.2), $this->size * $dotSize, $this->size * $dotSize, $color, 0, M_PI * 2);
     imageSmoothArc($im, $this->size * 3.35 / 2 + $this->size * $dotSize * ($movePerct - 0.2), $this->size * 3.35 / 2 + $this->size * $dotSize * ($movePerct - 0.2), $this->size * $dotSize, $this->size * $dotSize, $color, 0, M_PI * 2);
     imageSmoothArc($im, $this->size * 3.35 / 2 - $this->size * $dotSize * ($movePerct - 0.2), $this->size * 3.35 / 2 + $this->size * $dotSize * ($movePerct - 0.2), $this->size * $dotSize, $this->size * $dotSize, $color, 0, M_PI * 2);
     return $im;
 }
开发者ID:gdbhosale,项目名称:fancy-qr-code-generator,代码行数:13,代码来源:QrTagFrameDotTriCircle.php


示例5: DrawImageSmoothArc

 function DrawImageSmoothArc($im, $xc, $yc, $w, $h, $s, $e, $color, $style = null)
 {
     $tmp = $s;
     $s = (360 - $e) / 180 * M_PI;
     $e = (360 - $tmp) / 180 * M_PI;
     return imageSmoothArc($im, round($xc), round($yc), round($w), round($h), $this->CreateColorForImageSmoothArc($color), $s, $e);
 }
开发者ID:hcvcastro,项目名称:pxp,代码行数:7,代码来源:gd_image.inc.php


示例6: imageSmoothArc

function imageSmoothArc(&$img, $cx, $cy, $w, $h, $color, $start, $stop)
{
    // Originally written from scratch by Ulrich Mierendorff, 06/2006
    // Rewritten and improved, 04/2007, 07/2007
    // compared to old version:
    // + Support for transparency added
    // + Improved quality of edges & antialiasing
    // note: This function does not represent the fastest way to draw elliptical
    // arcs. It was written without reading any papers on that subject. Better
    // algorithms may be twice as fast or even more.
    // what it cannot do: It does not support outlined arcs, only filled
    // Parameters:
    // $cx      - Center of ellipse, X-coord
    // $cy      - Center of ellipse, Y-coord
    // $w       - Width of ellipse ($w >= 2)
    // $h       - Height of ellipse ($h >= 2 )
    // $color   - Color of ellipse as a four component array with RGBA
    // $start   - Starting angle of the arc, no limited range!
    // $stop    - Stop     angle of the arc, no limited range!
    // $start _can_ be greater than $stop!
    // If any value is not in the given range, results are undefined!
    // This script does not use any special algorithms, everything is completely
    // written from scratch; see http://de.wikipedia.org/wiki/Ellipse for formulas.
    while ($start < 0) {
        $start += 2 * M_PI;
    }
    while ($stop < 0) {
        $stop += 2 * M_PI;
    }
    while ($start > 2 * M_PI) {
        $start -= 2 * M_PI;
    }
    while ($stop > 2 * M_PI) {
        $stop -= 2 * M_PI;
    }
    if ($start > $stop) {
        imageSmoothArc($img, $cx, $cy, $w, $h, $color, $start, 2 * M_PI);
        imageSmoothArc($img, $cx, $cy, $w, $h, $color, 0, $stop);
        return;
    }
    $a = 1.0 * round($w / 2);
    $b = 1.0 * round($h / 2);
    $cx = 1.0 * round($cx);
    $cy = 1.0 * round($cy);
    $aaAngle = atan($b * $b / ($a * $a) * tan(0.25 * M_PI));
    $aaAngleX = $a * cos($aaAngle);
    $aaAngleY = $b * sin($aaAngle);
    $a -= 0.5;
    // looks better...
    $b -= 0.5;
    for ($i = 0; $i < 4; $i++) {
        if ($start < ($i + 1) * M_PI / 2) {
            if ($start > $i * M_PI / 2) {
                if ($stop > ($i + 1) * M_PI / 2) {
                    imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $start, ($i + 1) * M_PI / 2, $i);
                } else {
                    imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $start, $stop, $i);
                    break;
                }
            } else {
                if ($stop > ($i + 1) * M_PI / 2) {
                    imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $i * M_PI / 2, ($i + 1) * M_PI / 2, $i);
                } else {
                    imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $aaAngleX, $aaAngleY, $color, $i * M_PI / 2, $stop, $i);
                    break;
                }
            }
        }
    }
}
开发者ID:gdbhosale,项目名称:fancy-qr-code-generator,代码行数:70,代码来源:imageSmoothArc.php


示例7: imagealphablending

 }
 /**  Watched status ( DOT or Check Mark ) **/
 imagealphablending($im, true);
 if (INDICATOR == "DOT") {
     // half dot if partially watched
     if ($pos_right) {
         $pos_left = $pos_right;
     } else {
         $pos_left = $img_w - $img_w * $pad_right;
     }
     $pos_left = $pos_left * 1.1;
     if ($progress > 0) {
         imageSmoothArc($im, $pos_left, $dot_center, $dot_size, $dot_size, array(255, 165, 0, 5), 30, M_PI / 2);
     } else {
         if (!isset($_GET['watched']) or $_GET['watched'] == 0) {
             imageSmoothArc($im, $pos_left, $dot_center, $dot_size, $dot_size, array(255, 165, 0, 5), M_PI / 2, 0);
         }
     }
 }
 if (INDICATOR == "CHECK") {
     // mark it if watched
     if (isset($_GET['watched']) and $_GET['watched'] == 1) {
         $overlay = imagecreatefrompng('images/check-mark-512.png');
         // use the last right position if set for the new left
         if ($pos_right) {
             $pos_left = $pos_right;
         } else {
             $pos_left = $img_w - $img_w * $pad_right;
         }
         $pos_right = $pos_left + $check_box_size;
         $right_padding = $check_box_size * $pad_right;
开发者ID:PlexHaxx,项目名称:RARflixTools,代码行数:31,代码来源:poster.php


示例8: imageSmoothArc

            $r = $q;
            $g = $v;
            $b = $p;
            break;
        case 2:
            $r = $p;
            $g = $v;
            $b = $t;
            break;
        case 3:
            $r = $p;
            $g = $q;
            $b = $v;
            break;
        case 4:
            $r = $t;
            $g = $p;
            $b = $v;
            break;
        case 5:
            $r = $v;
            $g = $p;
            $b = $q;
            break;
        default:
            break;
    }
    imageSmoothArc($img, 325, 460, 620, 300, array($r * 255, $g * 255, $b * 255, 0), $i * 2 * M_PI / $n, ($i + 1) * 2 * M_PI / $n);
}
header('Content-Type: image/png');
imagePNG($img);
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:example.php


示例9: showGArea


//.........这里部分代码省略.........
                     $points = array($x1, $y1, $x2, $y2, $x2, $height_tot - 30, $x1, $height_tot - 30);
                     imagefilledpolygon($image, $points, 4, $alphapalette[$index1]);
                 }
                 //trace lines between points (if linear)
                 if (!$spline) {
                     $this->imageSmoothAlphaLineLarge($image, $x1, $y1, $x2, $y2, $palette[$index1]);
                 }
                 $aCoords[$x1] = $y1;
                 $old_data = $subdata;
                 $index2++;
                 $index3++;
             }
             //if curved spline activated, draw cubic spline for the current line
             if ($spline) {
                 $aCoords[$x2] = $y2;
                 $this->imageCubicSmoothLine($image, $palette[$index1], $aCoords);
                 $index2 = 0;
                 $old_data = 0;
                 $old_label = "";
             }
             //draw labels and dots
             $index2 = 0;
             $old_data = 0;
             foreach ($data as $subdata) {
                 //if first index, continue
                 if ($index2 == 0) {
                     $old_data = $subdata;
                     $old_label = $label;
                     $index2++;
                     continue;
                 }
                 // determine coords
                 $x1 = $index2 * $width_line - $width_line + 30;
                 $y1 = $height_tot - 30 - $old_data * ($height_tot - $height) / $max;
                 $x2 = $x1 + $width_line;
                 $y2 = $height_tot - 30 - $subdata * ($height_tot - $height) / $max;
                 //trace dots
                 $color_rbg = self::colorHexToRGB($darkerpalette[$index1]);
                 imageSmoothArc($image, $x1 - 1, $y1 - 1, 7, 7, $color_rbg, 0, 2 * M_PI);
                 imageSmoothArc($image, $x1 - 1, $y1 - 1, 4, 4, array(255, 255, 255, 0), 0, 2 * M_PI);
                 //display values label
                 if ($show_label == "always" || $show_label == "hover") {
                     imagettftext($image, $this->fontsize - 2, $this->fontangle, $index2 == 1 ? $x1 : $x1 - 6, $y1 - 5, $darkerpalette[$index1], $this->font, $old_data);
                 }
                 //show x-axis ticks
                 if ($step != 0 && $index3 / $step == round($index3 / $step)) {
                     imageline($image, $x1, $height_tot - 30, $x1, $height_tot - 27, $darkerpalette[$index1]);
                 }
                 $old_data = $subdata;
                 $old_label = $label;
                 $index2++;
                 $index3++;
             }
             /*** display last value ***/
             if (isset($x2)) {
                 //trace dots
                 $color_rbg = self::colorHexToRGB($darkerpalette[$index1]);
                 imageSmoothArc($image, $x2 - 1, $y2 - 1, 7, 7, $color_rbg, 0, 2 * M_PI);
                 imageSmoothArc($image, $x2 - 1, $y2 - 1, 4, 4, array(255, 255, 255, 0), 0, 2 * M_PI);
                 //display value label
                 if ($show_label == "always" || $show_label == "hover") {
                     imagettftext($image, $this->fontsize - 2, $this->fontangle, $index2 == 1 ? $x2 : $x2 - 6, $y2 - 5, $darkerpalette[$index1], $this->font, $old_data);
                 }
             }
             /*** end display last value ***/
             $index1++;
         }
         //display labels2
         $index = 0;
         foreach ($labels2 as $label) {
             $x = $index * $width_line + 20;
             if ($step != 0 && $index / $step == round($index / $step)) {
                 imagettftext($image, $this->fontsize - 1, $this->fontangle, $x, $height_tot - 10, $this->black, $this->font, $label);
             }
             $index++;
         }
         //legend (align left)
         $index = 0;
         foreach ($labels as $label) {
             //legend label
             $box = @imageTTFBbox($this->fontsize, $this->fontangle, $this->font, $label);
             $textwidth = abs($box[4] - $box[0]);
             $textheight = abs($box[5] - $box[1]);
             imagettftext($image, $this->fontsize - 1, $this->fontangle, 20, 35 + $index * 14, $this->black, $this->font, $label);
             //legend circle
             $color_rbg = self::colorHexToRGB($palette[$index]);
             imageSmoothArc($image, 10, 30 + $index * 14, 7, 7, $color_rbg, 0, 2 * M_PI);
             $index++;
         }
     }
     //generate image
     $params = array("image" => $image, "export" => $export, "f_name" => $opt['f_name'], "class" => $opt['class'], "title" => $title, "randname" => $randname, "raw_datas" => $raw_datas, "withdata" => $opt['withdata']);
     $contents = $this->generateImage($params);
     if ($show_graph) {
         $this->showImage($contents, $export);
     }
     $opt['randname'] = $randname;
     $options = array("opt" => $opt, "export" => $export, "datas" => $datas, "labels2" => $labels2, "flip_data" => $flip_data, "unit" => $unit);
     PluginMreportingCommon::endGraph($options);
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:graphpng.class.php


示例10: imageSmoothArc

function imageSmoothArc(&$img, $cx, $cy, $w, $h, $color, $start, $stop)
{
    while ($start < 0) {
        $start += 2 * M_PI;
    }
    while ($stop < 0) {
        $stop += 2 * M_PI;
    }
    while ($start > 2 * M_PI) {
        $start -= 2 * M_PI;
    }
    while ($stop > 2 * M_PI) {
        $stop -= 2 * M_PI;
    }
    if ($start > $stop) {
        imageSmoothArc(&$img, $cx, $cy, $w, $h, $color, $start, 2 * M_PI);
        imageSmoothArc(&$img, $cx, $cy, $w, $h, $color, 0, $stop);
        return;
    }
    $a = 1.0 * round($w / 2);
    $b = 1.0 * round($h / 2);
    $cx = 1.0 * round($cx);
    $cy = 1.0 * round($cy);
    for ($i = 0; $i < 4; $i++) {
        if ($start < ($i + 1) * M_PI / 2) {
            if ($start > $i * M_PI / 2) {
                if ($stop > ($i + 1) * M_PI / 2) {
                    imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $color, $start, ($i + 1) * M_PI / 2, $i);
                } else {
                    imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $color, $start, $stop, $i);
                    break;
                }
            } else {
                if ($stop > ($i + 1) * M_PI / 2) {
                    imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $color, $i * M_PI / 2, ($i + 1) * M_PI / 2, $i);
                } else {
                    imageSmoothArcDrawSegment($img, $cx, $cy, $a, $b, $color, $i * M_PI / 2, $stop, $i);
                    break;
                }
            }
        }
    }
}
开发者ID:rezarahimi4861,项目名称:icmf,代码行数:43,代码来源:function.imagesize.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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