...

View Full Version : use image with imagecreatefromjpeg(



sonny
02-27-2012, 08:53 AM
Hi I have a location map based on lon and lat, everything works fine


$im = imagecreatefromjpeg("earth.jpg");
$dotcolor = imagecolorallocate ($im, 255,255,0);//yellow
imagefilledrectangle($im,$pt["x"]-2,$pt["y"]-2,$pt["x"]+2,$pt["y"]+2,$dotcolor);

is their a way to use a image png as my location dot, instead of using the
imagecolorallocate code which produces a box like point?

Thanks
Sonny

KuriosJon
02-27-2012, 12:51 PM
You can use imagecopyresampled() (http://php.net/manual/en/function.imagecopyresampled.php) to copy one image into another image.

If you just want a dot, what about using imagefilledellipse() (http://php.net/manual/en/function.imagefilledellipse.php)?

sonny
02-27-2012, 07:42 PM
I tried that before posting, I can't get that to work, I don't think the image
combines with the earth image, it just position's over it or something.

I'm just trying to get a round png location (point) on a earth image. I know
it can be done I see it all the time.

Sonny



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum