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

PHP text_arc函数代码示例

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

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



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

示例1: mkimageTask

 /**
  * Create graphics
  *
  * @return  void
  */
 public function mkimageTask()
 {
     if (!$this->graphics_avail()) {
         exit(0);
     }
     function block_sort($array1, $array2)
     {
         if ($array1['offset'] > $array2['offset']) {
             return 1;
         } else {
             return -1;
         }
     }
     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);
             }
         }
     }
     function text_arc($im, $centerX, $centerY, $diameter, $start, $end, $color1, $text, $placeindex = 0)
     {
         $r = $diameter / 2;
         $w = deg2rad((360 + $start + ($end - $start) / 2) % 360);
         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);
         }
     }
     function fill_box($im, $x, $y, $w, $h, $color1, $color2, $text = '', $placeindex = '')
     {
         global $col_black;
         $x1 = $x + $w - 1;
         $y1 = $y + $h - 1;
         imagerectangle($im, $x, $y1, $x1 + 1, $y + 1, $col_black);
         if ($y1 > $y) {
             imagefilledrectangle($im, $x, $y, $x1, $y1, $color2);
         } else {
             imagefilledrectangle($im, $x, $y1, $x1, $y, $color2);
         }
         imagerectangle($im, $x, $y1, $x1, $y, $color1);
         if ($text) {
             if ($placeindex > 0) {
                 if ($placeindex < 16) {
                     $px = 5;
                     $py = $placeindex * 12 + 6;
                     imagefilledrectangle($im, $px + 90, $py + 3, $px + 90 - 4, $py - 3, $color2);
                     imageline($im, $x, $y + $h / 2, $px + 90, $py, $color2);
                     imagestring($im, 2, $px, $py - 6, $text, $color1);
                 } else {
                     if ($placeindex < 31) {
                         $px = $x + 40 * 2;
                         $py = ($placeindex - 15) * 12 + 6;
                     } else {
                         $px = $x + 40 * 2 + 100 * intval(($placeindex - 15) / 15);
                         $py = $placeindex % 15 * 12 + 6;
                     }
                     imagefilledrectangle($im, $px, $py + 3, $px - 4, $py - 3, $color2);
                     imageline($im, $x + $w, $y + $h / 2, $px, $py, $color2);
                     imagestring($im, 2, $px + 2, $py - 6, $text, $color1);
                 }
             } else {
                 imagestring($im, 4, $x + 5, $y1 - 16, $text, $color1);
             }
         }
     }
     $MYREQUEST = $this->MYREQUEST;
     $mem = $this->mem;
     $cache = $this->cache;
     $size = GRAPH_SIZE;
     // image size
     if ($MYREQUEST['IMG'] == 3) {
         $image = imagecreate(2 * $size + 150, $size + 10);
     } else {
//.........这里部分代码省略.........
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:101,代码来源:apc.php


示例2: fill_arc

             $ptr = $block['offset'] + $block['size'];
         }
         if ($ptr < $mem['seg_size']) {
             // memory at the end
             $angle_to = $angle_from + ($mem['seg_size'] - $ptr) / $s;
             if ($angle_to + $fuzz > 1) {
                 $angle_to = 1;
             }
             fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
             if ($angle_to - $angle_from > 0.05) {
                 array_push($string_placement, array($angle_from, $angle_to));
             }
         }
     }
     foreach ($string_placement as $angle) {
         text_arc($image, $x, $y, $size, $angle[0] * 360, $angle[1] * 360, $col_black, bsize($s * ($angle[1] - $angle[0])));
     }
     break;
 case 2:
     $s = $cache['num_hits'] + $cache['num_misses'];
     $a = $cache['num_hits'];
     fill_box($image, 30, $size, 50, -$a * ($size - 21) / $s, $col_black, $col_green, sprintf("%.1f%%", $cache['num_hits'] * 100 / $s));
     fill_box($image, 130, $size, 50, -max(4, ($s - $a) * ($size - 21) / $s), $col_black, $col_red, sprintf("%.1f%%", $cache['num_misses'] * 100 / $s));
     break;
 case 3:
     $s = $mem['num_seg'] * $mem['seg_size'];
     $a = $mem['avail_mem'];
     $x = 130;
     $y = 1;
     $j = 1;
     // This block of code creates the bar chart.  It is a lot more complex than you
开发者ID:kaoruu,项目名称:centos-php56,代码行数:31,代码来源:apc.php


示例3: indexAction


//.........这里部分代码省略.........
                                    fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
                                    if ($angle_to - $angle_from > 0.05) {
                                        array_push($string_placement, array($angle_from, $angle_to));
                                    }
                                }
                                $angle_from = $angle_to;
                            }
                            $angle_to = $angle_from + $block['size'] / $s;
                            if ($angle_to + $fuzz > 1) {
                                $angle_to = 1;
                            }
                            if ($angle_to * 360 - $angle_from * 360 >= 1) {
                                fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_green);
                                if ($angle_to - $angle_from > 0.05) {
                                    array_push($string_placement, array($angle_from, $angle_to));
                                }
                            }
                            $angle_from = $angle_to;
                            $ptr = $block['offset'] + $block['size'];
                        }
                        if ($ptr < $mem['seg_size']) {
                            // memory at the end
                            $angle_to = $angle_from + ($mem['seg_size'] - $ptr) / $s;
                            if ($angle_to + $fuzz > 1) {
                                $angle_to = 1;
                            }
                            fill_arc($image, $x, $y, $size, $angle_from * 360, $angle_to * 360, $col_black, $col_red);
                            if ($angle_to - $angle_from > 0.05) {
                                array_push($string_placement, array($angle_from, $angle_to));
                            }
                        }
                    }
                    foreach ($string_placement as $angle) {
                        text_arc($image, $x, $y, $size, $angle[0] * 360, $angle[1] * 360, $col_black, bsize($s * ($angle[1] - $angle[0])));
                    }
                    break;
                case 2:
                    $s = $cache['num_hits'] + $cache['num_misses'];
                    $a = $cache['num_hits'];
                    fill_box($image, 30, $size, 50, -$a * ($size - 21) / $s, $col_black, $col_green, sprintf("%.1f%%", $cache['num_hits'] * 100 / $s));
                    fill_box($image, 130, $size, 50, -max(4, ($s - $a) * ($size - 21) / $s), $col_black, $col_red, sprintf("%.1f%%", $cache['num_misses'] * 100 / $s));
                    break;
                case 3:
                    $s = $mem['num_seg'] * $mem['seg_size'];
                    $a = $mem['avail_mem'];
                    $x = 130;
                    $y = 1;
                    $j = 1;
                    // This block of code creates the bar chart.  It is a lot more complex than you
                    // would expect because we try to visualize any memory fragmentation as well.
                    for ($i = 0; $i < $mem['num_seg']; $i++) {
                        $ptr = 0;
                        $free = $mem['block_lists'][$i];
                        foreach ($free as $block) {
                            if ($block['offset'] != $ptr) {
                                // Used block
                                $h = (GRAPH_SIZE - 5) * ($block['offset'] - $ptr) / $s;
                                if ($h > 0) {
                                    $j++;
                                    if ($j < 75) {
                                        fill_box($image, $x, $y, 50, $h, $col_black, $col_red, bsize($block['offset'] - $ptr), $j);
                                    } else {
                                        fill_box($image, $x, $y, 50, $h, $col_black, $col_red);
                                    }
                                }
                                $y += $h;
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:67,代码来源:ApcController.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP text_area函数代码示例发布时间:2022-05-23
下一篇:
PHP textLength函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap