PHP Example Tutorial: How to create a picture on a Web page using PHP code
How do you use PHP code to generate images on a Web page in a PHP language Web page? The main content of today's PHP example tutorial is about how to implement a simple method of generating images on a webpage, which is a very simple and practical technique for PHP programming , and interested friends can refer to the relevant code for everyone to enumerate.
We can first look at:
This PHP learning code is very simple, the test code is as follows:
?
| 1 2 3 4 5 Span style= "color: #000000;" >6 7 8 Span style= "color: #000000;" >9 10 11 Span style= "color: #000000;" >12 |
? /** * Created by Phpstorm. * User:administrator * DATE:2015/6/29 * TIME:21:25 */ Header (' content-type:image/png ');//Set MIME type $img = Imagecreate (400,300);//Set picture pixels Imagecolorallocate ($img, 255,255,255);//Color pictures Imageellipse ($img, 200,200,50,50,imagecolorallocate ($img, 255,0,0));//Draw a graphic on the picture, center point 200,200; width High 50,50 Imagepng ($img);//Set the picture format to PNG |
? The above is the PHP example Tutorial Learning, the use of PHP code can be easily implemented on the Web page to generate pictures, I hope the content of this article on everyone's PHP programming help.