PHP Example Tutorial: The steps to create a picture on a Web page using PHP code

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.