ShadowColor for labels in SWF output
Yewondwossen Assefa
assefa at DMSOLUTIONS.CA
Wed Jul 4 09:24:33 EDT 2007
Laurent,
There is a bug tracking this: http://trac.osgeo.org/mapserver/ticket/2137
You could maybe add your self in cc on it.
Later,
Laurent B wrote:
> 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.
>
--
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst
Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/
Phone: (613) 565-5056 (ext 14)
Fax: (613) 565-0925
----------------------------------------------------------------
More information about the mapserver-dev
mailing list