[Mapserver-users] [PHP/MS 3.7-dev]: setRGB() conflicts with createLegendIcon() ?

Steve Lime steve.lime at dnr.state.mn.us
Fri Feb 21 17:15:11 EST 2003


That's a good hint but not the longterm fix. Setting pens is expensive
so we still need that check. You don't want to have to compute color
indexes for every feature drawn, that's a ton of lookups and perhaps
worse distance computations. My guess is that  pen values need to be
unset between map and legend drawing since palettes are definitely going
to be different between the 2 images. There's a utility function to do
just that  for all styles. It's called between map draws (assuming
MapScript use) and should be called  before a legend is created. I'll
look tonite...

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> Vinko Vrsalovic <vinko at cprsig.cl> 02/21/03 03:58PM >>>
On Fri, Feb 21, 2003 at 04:15:54PM -0500, Daniel Morissette wrote:
> Vinko Vrsalovic wrote:
> > 
> > When using setRGB, and then createLegendIcon(), the color drawn is
not the
> > one I set, but another (apparently random) one. But, if I use
> > map->save() and create a mapObj from the saved one, and draw an
image using
> > the saved mapfile, it shows the correct color.
> > 
> 
> FYI I think this must be related to a color handling problem
described
> in bugs 276 and 275:
> http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=276 
> http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=275 

Yes, that certainly is related to my problem, i applied the solution
of
changing this

  if(style->backgroundcolor.pen == MS_PEN_UNSET) msImageSetPenGD(img,
&(style->backgroundcolor));

for this
  
  msImageSetPenGD(img, &(style->backgroundcolor));

(Well, all three, obviously, not only the bgcolor)

in all mapgd.c and now it works correctly.

I changed that in all occurrences of SetPen related to style. 

I left the occurrences related to label as is, to test if this fails on
labels too. 
I will report on that one soon.


-- 
Vinko Vrsalovic <el[|- at -|]vinko.cl>
http://www.cprsig.cl 
_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu 
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list