PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Adding watermarks to images using alpha channels> <Предопределенные константы
Last updated: Fri, 05 Sep 2008

view this page in

Примеры

Содержание

Пример #1 PNG creation with PHP

<?php

header
("Content-type: image/png");
$string $_GET['text'];
$im     imagecreatefrompng("images/button1.png");
$orange imagecolorallocate($im22021060);
$px     = (imagesx($im) - 7.5 strlen($string)) / 2;
imagestring($im3$px9$string$orange);
imagepng($im);
imagedestroy($im);

?>
This example would be called from a page with a tag like: <img src="button.php?text=text">. The above button.php script then takes this "text" string and overlays it on top of a base image which in this case is "images/button1.png" and outputs the resulting image. This is a very convenient way to avoid having to draw new button images every time you want to change the text of a button. With this method they are dynamically generated.



add a note add a note User Contributed Notes
Примеры
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites