开发者

SolidColorBrush problem in silverlight

开发者 https://www.devze.com 2023-04-06 06:37 出处:网络
I have problem with SolidColorBrush setting. I create polygon layer in bing map control in silverlight. When I set color as:

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

精彩评论

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

关注公众号