Home  >  Article  >  Backend Development  >  用PHP代码在网页上生成图片_PHP教程

用PHP代码在网页上生成图片_PHP教程

WBOY
WBOYOriginal
2016-07-13 09:48:061101browse

用PHP代码在网页上生成图片

   这篇文章主要介绍了用PHP代码在网页上生成图片的方法和实例,十分的简单实用,有需要的小伙伴可以参考下。

  代码很简单,这里就不多废话了,

  ?

1

2

3

4

5

6

7

8

9

10

11

12

/**

* Created by PhpStorm.

* User: Administrator

* Date: 2015/6/29

* Time: 21:25

*/

header('Content-type:image/png');//设置mime type

$img = imagecreate(400,300);//设置图片像素

imagecolorallocate($img,255,255,255);//给图片上色

imageellipse($img,200,200,50,50,imagecolorallocate($img,255,0,0));//在图片上绘制图形,中心点200,200;宽高50,50

imagepng($img);//设置图片格式为PNG

  效果如下:

  以上所述就是本文的全部内容了,希望大家能够喜欢。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1025317.htmlTechArticle用PHP代码在网页上生成图片 这篇文章主要介绍了用PHP代码在网页上生成图片的方法和实例,十分的简单实用,有需要的小伙伴可以参考下。...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn