ShadowColor for labels in SWF output

Laurent B laurent.baey at FREE.FR
Thu Jun 28 11:00:46 EDT 2007


Hi
I'm new to this list, and I apologize if I don't follow list rules I  
don't know yet...

I wanted some fancy outline on labels in my swfs like in my png  
output, but i wasn't able to do so, neither was I able to set a  
background on the labels.
If anyone knows a way, please give me a lead I'd be happy to do it...
anyway, I ended adding a shadow of size 1 on labels where a  
shadowcolor is set in the mapfile.

If anyone is interested... maybe some comments, to fit the code better  
in mapserver source.
thank you all
here follows the diff from my mapswf.c

Laurent
(a french guy trying to write english)

2017a2018
>     colorObj    sShadowColor;
2019a2021
>     SWFText     oShadowText = NULL;
2020a2023
>     int        drawShadow = 0; /* flag : do we need to draw shadow or not */
2076a2080,2082
>     sShadowColor.red = 0;
>     sShadowColor.green = 0;
>     sShadowColor.blue = 0;
2090,2095d2095
<     else if (MS_VALID_COLOR(label->shadowcolor))
<     {
<         sColor.red = label->shadowcolor.red;
<         sColor.green = label->shadowcolor.green;
<         sColor.blue = label->shadowcolor.blue;
<     }
2100a2101,2109
>     /* check if a shadow color was defined */
>     if (MS_VALID_COLOR(label->shadowcolor))
>     {
>         sShadowColor.red = label->shadowcolor.red;
>         sShadowColor.green = label->shadowcolor.green;
>         sShadowColor.blue = label->shadowcolor.blue;
>         // then draw one
>         drawShadow = 1;
>     }
2107a2117,2130
>
>     /* first  draw the shadow with a x+1,y+1 position */
>     if (drawShadow) {
>     oShadowText = DrawText(string, 0, 0, msBuildPath(szPath,  
> fontset->filename, font), size, &sShadowColor);
>         if (oShadowText)
>         {
>             SWFDisplayItem oShadowDisplay;
>             /* nTmp = ((SWFObj *)image->img.swf)->nCurrentMovie; */
>             oShadowDisplay = SWFMovie_add(GetCurrentMovie(map,  
> image), oShadowText);
>             SWFDisplayItem_moveTo(oShadowDisplay, (float)x + 1,  
> (float)y + 1);
>             SWFDisplayItem_rotate(oShadowDisplay, (float)label->angle);
>         }
>     }
>     /* then draw the text */
2111c2134
<          SWFDisplayItem oDisplay;
---
>          SWFDisplayItem oDisplay;
2117d2139
<




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the mapserver-dev mailing list