VDS Technologies

 

semitransparent fill color with solid fill style

8/27/2012 9:35:14 AM
Total Posts 18

semitransparent fill color with solid fill style

Can I make semitransparent fill color with solid fill style. I have tried something like this:

 

Color transparentPink = Color.FromArgb(100, Color.Pink);

layer.Symbol.FillColor = transparentPink ;

layer.Symbol.FillStyle = FillStyle.Solid;

 

The member transparentPink has the correct alpha value 100, but then I bind to property "FillColor" the alpha value in FillColor is 255. I know that I can use "FillStyle.LightGray" but this is not that I want show. I really like to show semitransparent color and no little points.

Here you have can see an sample image: https://lh4.googleusercontent.com/-noRq1WcfiOI/UDt28VfjwHI/AAAAAAAAAA4/DCRvqwOone0/s960/Layer%2520-%2520semitransparent.png

8/28/2012 9:22:18 AM
MVP
Total Posts 323

Re: semitransparent fill color with solid fill style

Semi-transparency is supported per-layer, see the Layer.Opacity property.

It is not supported for separate shapes.

9/4/2012 5:57:58 AM
Total Posts 18

Re: semitransparent fill color with solid fill style

So, I have added Layer-Opacity now:

Layer layer = map.AddLayer("something.shp");

layer.Opacity = 0.7;

 

layer.Symbol.FillColor = Color.Pink;

layer.Symbol.FillStyle = FillStyle.Solid;

layer.Symbol.LineColor = Color.DarkMagenta;

layer.Symbol.LineStyle = LineStyle.Solid;

layer.Symbol.Size = 2;

layer.LabelField ="Name";

layer.ShowLabels =true;

layer.LabelFont.Size = 24;

layer.LabelFont.Color =Color.DarkMagenta;

layer.LabelFont.Outline =true;

layer.LabelFont.OutlineColor =Color.White;

layer.LabelFont.Italic =true;

layer.CoordinateSystem = CoordSystem.WGS1984;

layer.MinScale = 1;

layer.MaxScale = ZOOM_LEVEL_STATE;

 

My problem is now, that I can see the data behind the semitransparent layer very difficult. The street name looks for example very pale (see image - at the bottom right). I have problems to read them. In other map tool which I have seen, they use alpha value from color (see first post) and I can see the street name very good.

I also can set transparency only for fill color. With your solution the Line is also Transparent.

Image: https://picasaweb.google.com/lh/photo/Gvp-0z11WURTggtEIRBlgdMTjNZETYmyPJy0liipFm0?feat=directlink

9/5/2012 3:51:10 AM
MVP
Total Posts 323

Re: semitransparent fill color with solid fill style

Labels are displayed at the end of the map rendering process and they are free from the opacity settings. Check the WorldMap sample, even if you sett all the layers in this sample to Opacity=0.3, the labels will not be affected. Seems as the something.shp layer is added over a non-AspMap layer.

9/5/2012 9:57:18 AM
Total Posts 18

Re: semitransparent fill color with solid fill style

The text which will hide from semitransparent layer is from wms layer - so I can't see them correct. But you have say me in other post also, that I don't can show wms layer on top (http://vdstech.com/Forums/Thread.aspx?pageid=34&mid=13&ItemID=1&thread=54).

My other problem is, that I can not set opacity for legend and so I see in legend the Color "Pink" and in the map I see an semitransparent pink. That can I do here?