开发者

SolidColorBrush problem in silverlight

I have problem with SolidColorBrush setting. I create polygon layer in bing map control in silverlight. When I set color as:

        Dim kocka As New Microsoft.Maps.MapControl.MapPolygon()
        kocka.Fill = New SolidColorBrush(Colors.Blue)

everything is OK and polygon is 开发者_Python百科displayed. But, when I use this approach (dynamic setting):

        Dim kocka As New Microsoft.Maps.MapControl.MapPolygon()
        kocka.Fill = New SolidColorBrush(Color.FromArgb(0, 233, 14, 55))

        'OR: Color.FromArgb(CByte(0), CByte(233), CByte(14), CByte(55)))

the polygon is not displayed. What is wrong? I tried everything and nothing works.

Thanks


The first parameter in Color.FromArgb is the Alpha channel (aka opacity). A value of 0 will make it fully transparent, so you should set it to something greater than 0 if you want to actually see the color. For instance:

kocka.Fill = New SolidColorBrush(Color.FromArgb(255, 233, 14, 55))

Check out this Wikipedia article for more information on ARGB colors.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜