PHP/Graphics Image/imagecolortransparent — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 10:05, 26 мая 2010
Adding Transparency
<source lang="html4strict">
<?
$image = imagecreatetruecolor(400,400); $black = imagecolorallocate($image, 0, 0, 0); imagecolortransparent($image, $black);
?>
</source>
Using Brushes
<source lang="html4strict">
<?
$brush = imagecreate(100,100); $brushtrans = imagecolorallocate($brush, 0, 0, 0); imagecolortransparent($brush, $brushtrans); for ($k = 1; $k < 18; ++$k) { $color = imagecolorallocate($brush, 255, $k * 15, 0); imagefilledellipse($brush, $k * 5, $k * 5, 5, 5, $color); } imagepng($brush); imagedestroy($brush);
?>
</source>