Transparent Pixmap Background in MapScript

Fawcett, David David.Fawcett at STATE.MN.US
Mon Nov 21 21:53:46 EST 2005


I know that I have seen the proper code before, but my search hasn't been able to relocate it.  

In python mapscript, I am creating a pixmap symbol from a gif.  I am building everything without a map file.  Everything works, but I end up getting a black background on my transparent gif symbol.  

I am pretty sure that I need to set a color or background color, but can't get it quite right.  

Here is what I am trying: 

# add the image symbol we defined above to the inline layer
cls = mapscript.classObj(inline_layer)
cls.name='classname'
style = mapscript.styleObj(cls)
style.symbol = mymap.symbolset.index('from_img')
style.backgroundcolor.setRGB(-1, -1, -1)
style.color.setRGB(-1, -1, -1)


Thanks, 

David.



More information about the mapserver-users mailing list