简体   繁体   中英

Wpf gradient Equivalent of css Gradient

请问以下css梯度的wpf等效值是多少

background-image: -webkit-gradient(linear, 0 0, 0 27, from(#003489), color-stop(0.074, #003485), color-stop(0.111, #01358b), to(#003788));

I would use LinearGradientBrush

    LinearGradientBrush gradientBrush = new  LinearGradientBrush( Color.FromRgb( 0, 20, 54),  Color.FromRgb(0, 21, 55), new Point(0, 0), new Point(0, 27));
        Background = gradientBrush;

And although this isn't exactly what you asked, it should give you the guidance to get there! Happy coding

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM