########
bimage.php3
########
/*
函数说明
$chartdata:数据,是数组元素
$chartfont:字号
$chartdiameter:决定饼的大小(要看你饿不饿了,呵呵)
$chartlabel:标题,也是数组元素
$colorslice:颜色数组,例如$tmp=array255,255,255);$colorslic=array($tmp);
$colorborder:边框颜色,数组
$colortext :文本颜色,数组
$colorbody:背景颜色,数组
$file:输出图片文件名*/
function bimage($chartdata,
$chartfont,
$chartdiameter ,
$chartlabel ,
$colorslice,
$colorbody ,
$colorborder,
$colortext ,
$file
)
{
$chartdiameter=150;
$chartfontheight=imagefontheight($chartfont);
$d1=10;$d2=20;$d3=30;$d4=40;$d5=50;
$chartdata=array($d1,$d2,$d3,$d4,$d5);
$chartlabel=array("D1","D2","D3","D4","D5");
$chartwidth=$chartdiameter+20;
$chartheight=$chartdiameter+20+(($chartfontheight+2)*count($chartdata));
header("content-type:image/gif");
$image=imagecreate($chartwidth,$chartheight);
$colorbody =imagecolorallocate ($image,$colorbody[0],$colorbody[1],$colorbody[2]);
$colortext =imagecolorallocate ($image,$colortext[0],$colortext[1],$colortext[2]);
$colorborder =imagecolorallocate ($image,$colorborder[0],$colorborder[1],$colorborder[2]);
for ($i=0;$i {
$t=imagecolorallocate($image,$colorslice[$i][0],$colorslice[$i][1],$colorslice[$i][2]);
$colorslice[$i]=$t;
}
for($i=0;$i {
$charttotal+=$chartdata[$i];
}
$chartcenterx=$chartdiameter/2+10;
$chartcentery=$chartdiameter/2+10;
$degrees=0;
for($i=0;$i {
$startdegrees=round($degrees);
$degrees+=(($chartdata[$i]/$charttotal)*360);
$enddegrees=round($degrees);
$currentcolor=$colorslice[$i%(count($colorslice))];
imagearc($image ,
$chartcenterx,
$chartcentery,
$chartdiameter,
$chartdiameter,
$startdegrees,
$enddegrees,
$currentcolor);
list($arcx,$arcy)=circle_point($startdegrees,$chartdiameter);
imageline($image,
$chartcenterx,
$chartcentery,
floor($chartcenterx+$arcx),
floor($chartcentery+$arcy),
$currentcolor );
list($arcx,$arcy)=circle_point($enddegrees,$chartdiameter);
imageline($image,
$chartcenterx,
$chartcentery,
ceil($chartcenterx+$arcx),
ceil($chartcentery +$arcy),
$currentcolor);
$midpoint=round((($enddegrees-$startdegrees)/2)+$startdegrees);
list($arcx,$arcy)= circle_point ( $midpoint, $chartdiameter/2);
imagefilltoborder($image,
floor($chartcenterx+$arcx),
floor($chartcentery+$arcy),
$currentcolor,
$currentcolor);
}
imagearc($image,
$chartcenterx,
$chartcentery,
$chartdiameter,
$chartdiameter,
0,360,
$colorborder);
imagefilltoborder ($image,
floor($chartcenterx +( $chartdiameter /2)+2),
$chartcentery ,
$colorborder,
$colorborder );
for ($i=0;$i {
$currentcolor=$colorslice[$i%(count($colorslice))];
$liney=$chartdiameter+20+($i*($chartfontheight+2));
imagerectangle ($image,
10,
$liney,
20+$chartfontheight,
$liney+$chartfontheight,
$colorbody);
imagefilltoborder($image,
12,
$liney+2,
$colorbody,
$currentcolor);
imagestring($image,
$chartfont,
40+$chartfontheight,
$liney,
"$chartlabel[$i]:$chartdata[$i]",
$colortext);
}
imagegif ($image,$file);
}
function radians($degrees)
{
return($degrees*(pi()/180.0));
}
function circle_point($degrees,$diameter)
{
$x=cos(radians($degrees))*($diameter/2);
$y=sin(radians($degrees))*($diameter/2);
return (array($x,$y));
}
?>
###########
这是一个调用的例子
###########
include("bfunc.php3");
$chartdiameter=250;
$chartfont=5;
$d1=10;$d2=20;$d3=30;$d4=40;$d5=50;
$chartdata=array($d1,$d2,$d3,$d4,$d5);
$chartlabel=array("D1","D2","D3","D4","D5");
$colorbody=array(0xff,0xff,0xff);
$colorborder=array(0x00,0x00,0x00);
$colortext=array(0xff,0xff,0xff);
$color1=array(0xff,0x00,0x00);
$color2=array(0x00,0xff,0x00);
$color3=array(0x00,0x00,0xff);
$color4=array(0xff,0xff,0x00);
$color5=array(0xff,0x00,0xff);
$colorslice=array($color1 ,$color2,$color3,$color4,$color5);
$file="tj.gif"
bimage($chartdata,
$chartfont,
$chartdiameter ,
$chartlabel ,
$colorslice,
$colorbody ,
$colorborder,
$colortext ,
$file )
?>

本文将介绍七种利用免费的BingImageCreator获得高质量输出的方法。BingImageCreator(现称为MicrosoftDesigner的ImageCreator)是一个出色的在线人工智能艺术生成器之一。它能根据用户的提示生成高度逼真的视觉效果。提示越具体、清晰和创意,生成的效果也会更出色。BingImageCreator在创建高质量图像方面取得了重大进展。它现在使用Dall-E3培训模式,显示出更高水平的细节和现实主义。然而,它能否始终如一地生成高清结果取决于几个因素,包括快速

标题:C#中使用Array.Sort函数对数组进行排序的示例正文:在C#中,数组是一种常用的数据结构,经常需要对数组进行排序操作。C#提供了Array类,其中有Sort方法可以方便地对数组进行排序。本文将演示如何使用C#中的Array.Sort函数对数组进行排序,并提供具体的代码示例。首先,我们需要了解一下Array.Sort函数的基本用法。Array.So

小米手机image怎么删除?在小米手机中是可以删除image,但是多数的用户不知道image如何的删除,接下来就是小编为用户带来的小米手机image删除方法教程,感兴趣的用户快来一起看看吧!小米手机image怎么删除1、首先打开小米手机中的【相册】功能;2、然后勾选不需要的图片,点击右下角的【删除】按钮;3、之后点击最顶部的【相册】进入到专区,选择【回收站】;4、接着直接点击下图所示的【清空回收站】;5、最后直接点击【永久删除】即可完成。

在进行PHP编程时,我们常常需要对数组进行合并。PHP提供了array_merge()函数来完成数组合并的工作,不过当数组中存在相同的键时,该函数会覆盖原有的值。为了解决这个问题,PHP在语言中还提供了一个array_merge_recursive()函数,该函数可以合并数组并保留相同键的值,使得程序的设计变得更加灵活。array_merge

LINUX是一种开源的操作系统,它的灵活性和可定制性使得它成为了许多开发者和系统管理员的首选,在LINUX系统中,图像处理是一个非常重要的任务,而Imagemagick和Image是两个非常流行的图像处理工具,本文将为您介绍如何在Centos系统中安装Imagemagick和Image,并提供详细的安装教程。Imagemagic安装Centos教程Imagemagick是一个功能强大的图像处理工具集,它可以在命令行下执行各种图像操作,以下是在Centos系统上安装Imagemagick的步骤:1

在PHP中,有许多强大的数组函数可以使数组的操作更加方便和快捷。当我们需要将两个数组拼成一个关联数组时,可以使用PHP的array_combine函数来实现这一操作。这个函数实际上是用来将一个数组的键作为另一个数组的值,合并成一个新的关联数组。接下来,我们将会讲解如何使用PHP中的array_combine函数将两个数组拼成关联数组。了解array_comb

在PHP编程中,数组是一种非常重要的数据结构,能够轻松地处理大量数据。PHP中提供了许多数组相关的函数,array_fill()就是其中之一。本篇文章将详细介绍array_fill()函数的用法,以及在实际应用中的一些技巧。一、array_fill()函数概述array_fill()函数的作用是创建一个指定长度的、由相同的值组成的数组。具体来说,该函数的语法

Python中的array模块是一个预定义的数组,因此其在内存中占用的空间比标准列表小得多,同时也可以执行快速的元素级别操作,例如添加、删除、索引和切片等操作。此外,数组中的所有元素都是同一种类型,因此可以使用数组提供的高效数值运算函数,例如计算平均值、最大值和最小值等。另外,array模块还支持将数组对象直接写入和读取到二进制文件中,这使得在处理大量数值数据时更加高效。因此,如果您需要处理大量同质数据,可以考虑使用Python的array模块来优化代码的执行效率。要使用array模块,首先需要


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version
Chinese version, very easy to use

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
