Home > Backend Development > PHP Tutorial > 一个建立png图像的例子_PHP

一个建立png图像的例子_PHP

WBOY
Release: 2016-06-01 12:38:21
Original
905 people have browsed it

Header("Content-type: image/png");

$string=implode($argv," ");

$im = imageCreateFromPng("images/button1.png");

$orange = ImageColorAllocate($im, 220, 210, 60);

$px = (imagesx($im)-7.5*strlen($string))/2;

ImageString($im,3,$px,9,$string,$orange);

ImagePng($im);

ImageDestroy($im);

?>



如果你想传送文字
需要这样调用

img src="button.php?text=$buttonName" border=0 alt="">
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template