![]() |
use image instaed of rectangle on map
Hi, I currently use this line to create a tiny red dot plotted on a world map
anyone know how I can use a dot image instead? PHP Code:
Sonny |
Are you talking about using a separate image? You can use imagecopymerge to overlay a part of an image onto another image.
|
Quote:
I'm trying to do exactly this below on a world map image, only with a dot image instaed PHP Code:
Sonny |
PHP Code:
But can't get this to work, having a hard time transferring the values from imagefilledrectangle over to imagecopymerge, Sonny |
So not an external image?
Just use the imagefilledellipse method. The method is almost identical to the rectangle, but you provide w/h instead of end x/y. You can use some pi with the existing points to calculate the width (and height would be the same if you want a circle instead of an ellipse). |
Quote:
and the blank world map is a image as well. I would like to use a dot image, just need help transferring the values from rectangle above if anyone knows how please show me. Thanks Sonny |
Oh I see you posted one just before I.
image merging requires two image resources, so the second image needs to be opened with a createImageFrom* call to get a separate resource. Then you provide the arguments for x/y starting points on the destination, the source' x/y, and width/height arguments (presumably the full image?), and finally the alpha. If you need to make use of 2 sets of x/y components for a size like you had in the other one, you'll probably need to scale the dot's image resource prior to merging it. I don't think the resize works at a scaling level, but I could be wrong on that. |
Quote:
that complicated, thought I could transfer the values over to imagecopymerge and create a simple 1x1 red image. if anyone familer working with imagecopymerge can show me how to correctly use a dot image as I currently do now with imagefilledrectangle, please let me know. Sonny |
See now I'm a bit confused.
1x1 red image (solid I assume?) doesn't need a separate image for it. I thought that dot.png would be an external image, but if you are only working with a 1x1 (square) image, I don't see any reason to make a change. If you're talking about 'dot' being a circle, than use what I suggested with imagefilledellipse. |
| All times are GMT +1. The time now is 01:23 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.