[SOLVED]imagefilledpolygon
Posted: Fri Dec 01, 2006 9:28 am
feyd | Please use
Now, i can "echo" the $results onto the screen
But i can't seem to get my string of data to work in the magefilledpolygon string.
It is the $points data that i want to "echo" into the imagefilledpolygon string. But i can't "echo" the string there....i tried. Maybe i am not formating the result properly, but if echo the points to screen then copy and paste them into the imagefilledpolygon string, the image works fine.
Again, i just need a way to echo the data points into the imagefilledpolygon from my array "$results" that i created.
Any help would be great. Thank you.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I had a look around on Google and through these forums but i have yet ben able to figure this out.
And yes, my PHP skill is lacking...
What i have is an image that i want to create a filled polygon on top of - that isn't the problem. I can create the ploygons fine.
My problem lies in the fact that the data for the array of points won't "echo" into the imagefilledpolygon string.
For example..
I have an array that i created from the results of the data base looping through long and lat coords and plotting them onto the screen.Code: Select all
$results = array();
while($row = mysql_fetch_array($result)){
$GID = $row['GID'];
$lat = $row['Y1'];
$lon_result = $row['X1'];
$lon = ((-1)*($lon_result));
$pt = getlocationcoords($lat, $lon, $scale_x, $scale_y);
$x1 = $pt["x"];
$y1 = $pt["y"];
$results[] = "$x1,$y1,";
}Code: Select all
echo implode($results);Code: Select all
$points = implode($results);
$vertices = count($points) / 2;
//echo $points;
imagefilledpolygon($im, $points, $vertices , $red);Again, i just need a way to echo the data points into the imagefilledpolygon from my array "$results" that i created.
Any help would be great. Thank you.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]