Search the Community
Showing results for tags 'imagefill'.
-
I have a black and white image dividing a city into zip codes. So a bunch of shapes and that's it. I load it (imagecreatefrompng) and I'm filling the zipcodes with color based on coordinates of a spot in the zipcode and a color relevant to information about it. If I use imagefill (or imagefilltoborder) to fill a zip code it works great. But - I also need to apply text and lines to that image on top of those filled shapes. My problem is it's always doing the fill last no matter what order I put it in the code - so anywhere a line crosses a zipcode it only gets half filled in. For example I attached an image - if i turn off the lines the white box is filled in with a shade of red. Not a great example since I think the line is right on top of the coordinate of the fill but it does it all over the image. What am I missing? Is there not a way to choose the order your draw to the image object? Is there a way to apply a change before doign the next one short of writing and reloading the file?