


PHP generates 3D percentage graphic statistical effects_PHP tutorial
PHP generates 3D percentage graphic statistical effects This program is based on the data provided by the user to generate a 3D percentage image statistical effect, which is a bit like the Chinese webmaster
PHP tutorial to generate a 3D percentage graphic statistical effect
/*
This program generates 3D effect percentage picture statistics based on the data provided by the user. The effect is a bit like a Chinese webmaster
*/
$image = imagecreatetruecolor(200,200); //Create a 200*200 canvas;
//Create multiple and differentiated colors
$red = imagecolorallocate($image,255,0,0);
$blue = imagecolorallocate($image,0,0,255);
$yellow = imagecolorallocate($image,255,255,0);
$violet = imagecolorallocate($image,255,0,255);
$white = imagecolorallocate($image,255,255,255);
$black = imagecolorallocate($image,0,0,0);
//Use a for loop to create the underlying 3D effect
for($i=120;$i>100;$i--){
Imagefilledarc($image,100,$i,200,120,0,30,$red,img_arc_pie);//img_arc_pie annotation is as follows:imagefilledarc($image,100,$i,200,120,30,80,$blue,img_arc_pie);
Imagefilledarc($image,100,$i,200,120,80,360,$yellow,img_arc_pie);
}
//bool imagefilledarc (resource image, int cx, int cy, int w, int h, int s, int e, int color, int style)
//
//imagefilledarc() draws an elliptical arc using cx, cy (the upper left corner of the image is 0, 0) in the image represented by image. Returns true if successful, false if failed. w and h specify the width and height of the ellipse respectively, and the s and e parameters specify the start and end points in angles. style can be the bitwise OR (or) of the following values:
//
//img_arc_pie
//
//img_arc_chord
//
//img_arc_nofill
//
//img_arc_edged
//This layer is the effect of the top layer, so that the three-dimensional effect comes out!
Imagearc($image,100,100,200,120,0,360,$black);//Add a black border so that the 3D effect looks more obvious
Imagefilledarc($image,100,100,200,120,0,30,$red,img_arc_pie);
Imagefilledarc($image,100,100,200,120,30,80,$blue,img_arc_pie);
Imagefilledarc($image,100,100,200,120,80,360,$yellow,img_arc_pie);//Add percentage data. Of course, if necessary, you can perform certain operations in batches and input the input to the picture
$str = iconv ("gbk","utf-8","36%");//This conversion is required if you want to input Chinese. example: Occupied: 30%;
Imagettftext($image,10,360-15,100+70,115,$white,"simhei.ttf",$str);
imagejpeg($image);
imagedestroy($image);

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Validator can be created by adding the following two lines in the controller.
