Are you talking about using a separate image? You can use imagecopymerge to overlay a part of an image onto another image.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
imagefilledrectangle($im,$pt["x"]-2,$pt["y"]-2,$pt["x"]+2,$pt["y"]+2,$dotcolor);// WORKS
imagecopymerge ( resource $dst_im , resource $src_im , int $dst_x , int $dst_y , int $src_x , int $src_y , int $src_w , int $src_h , int $pct )
imagecopymerge($im, dot.png, $pt["x"]-2, $pt["y"]-2, $pt["x"]+2,$pt["y"]+2, 1, 1, 0);
Fou, that seems to be what I need
But can't get this to work, having a hard time transferring the values from imagefilledrectangle
over to imagecopymerge,
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).
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
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).
It is a external image named dot.png
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.
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.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
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.
Well, was worth a try, guess I will just stay with imagefilledrectangle, did not know it was
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.
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.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php