id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
4153	C# Mapscript problem setting opacity on style object	woodbri	tamas	"The mapfile STYLE block[1] has OPACITY [integer|attribute] but I do not see this attribute listed in the SWIG mapscript [2] styleObj Attributes list.

And I have a report that when trying to use this via .NET mapscript that it does not seem to work.

layerObj opacity seems to work just fine.

If I go the 

my_style.opacity = 50

route, it looks like it's being completely ignored in the resulting map.

If I go the

my_style.updateFromString(""STYLE OPACITY 50 END"")

route, then this also is sometimes ignored.  It is ignored if after having set the opacity I set the color with

my_style.color = New colorObj(0, 255, 0, 0)

but if I rearrange my statements such that the color is set before instead of after I set the opacity (opacity set with updateFromString) then all works just fine.  The other properties I set (symbol, width, outlinecolor) don't seem to have any similar order dependency as the transparency works just fine with them occurring either before or after the updateFromString call.

Stepping through the following snippet of code

                Dim fieldStyle As New OSGeo.MapServer.styleObj(fieldClass)
                With fieldStyle
                    .color = New colorObj(0, 255, 0, 0)
                    .opacity = 50
                    'set the opacity on the style
                    .updateFromString(""STYLE OPACITY 50 END"")
                    .color = New colorObj(0, 255, 0, 0)
                    .symbol = 0
                    .width = 1
                    .outlinecolor = New colorObj(0, 0, 0, 0)
                End With

(see attached Stepping.png image for the below)
After the first .color = line, the alpha for color is set to 255.
After the .opacity = line, the alpha for color is still 255.
After the .updateFromString line, the alpha for color is 127 or approximately 50%.
After the second .color = line, the alpha for color is back at 255.
The .outlinecolor.alpha is always 255 and doesn't seem to affect the eventual appearance of the map, rather the outline is opaque if color.alpha = 255 but semi-transparent if color.alpha is less than 255.

So, if I had to guess as to what's going on under the covers I'd guess that style.alpha is being completely ignored and color.alpha is dictating the transparency of both the fill and the outline.

Testing using MS4W version 3.0.3 which I believe would be MapServer 6.0.1. 32-bit version.
"	defect	new	normal		MapScript-C#	6.0	normal			
