Image editing Functions
Posted: Fri Oct 11, 2002 8:02 am
I have just started using the image editing functions in PHP. I installed the gd extension and it appears to be working(It displays an image). I am trying to write a script to place a an image of a pin on an image of a map.
I got this example from a book put it doesn't seem to work.
Can anyone tell me what is wrong with this script or suggest a way of doing it.
Thanks
Ozmodiar
I got this example from a book put it doesn't seem to work.
Code: Select all
<?php
Header("Content-type: image/jpeg");
$image = ImageCreateFromJPEG("map.jpg");
$icon = ImageCreateFromJPEG("pin.jpg");
$trans = ImageColorAt($icon, 0, 0);
ImageColorTransparant($icon, $trans);
$width = ImageSX($icon);
$height = ImageSY($ican);
ImageCopyResized($image, $icon, 20, 20, 0, 0, $width, $height, $width, $height);
ImageJPEG($image);
ImageDestroy($image);
?>Thanks
Ozmodiar