PHP/Language Basics/PNG
Add an PNG image to the image you generated
<?php
header("Content-type: image/png");
$src_filename = "http://www.wbex.ru/style/logo.PNG";
$src = @ImageCreateFromPng($src_filename) or die("Could not create source image");
$src_size = GetImageSize($src_filename);
$im = @ImageCreate(320, 200) or die("Could not create destination image");
$bg_color = ImageColorAllocate($im, 240, 240, 240);
$text_color = ImageColorAllocate($im, 0, 0, 0);
for($i = 0; $i < 5; $i++){
ImageCopy($im, $src, 100, $i * 25, 0, 0, $src_size[0], $src_size[1]);
}
ImagePng($im);
ImageDestroy($src);
ImageDestroy($im);
?>
Create PNG file
<html>
<body>
<?php
$img=ImageCreate(300,300);
$bgcolor=ImageColorAllocate($img,200,200,200);
$red=ImagecolorAllocate($img,255,0,0);
Imagerectangle($img,50,50,150,150,$red);
Imagefilledrectangle($img,50,170,150,270,$red);
ImagePNG($img,"pic.png");
ImageDestroy($img);
?>
<img src="pic.png" border=0>
</body>
</html>