Creating SolidColorBrush from hex color value

后端 未结 6 1489
挽巷
挽巷 2020-12-12 14:59

I want to create SolidColorBrush from Hex value such as #ffaacc. How can I do this?

On MSDN, I got :

SolidColorBrush mySolidColorBrush = new SolidCol         


        
6条回答
  •  囚心锁ツ
    2020-12-12 15:06

    Try this instead:

    (SolidColorBrush)(new BrushConverter().ConvertFrom("#ffaacc"));
    

提交回复
热议问题