CSharp examples for System.Windows.Media:Brush
Creates a copy of a brush with the specified opacity.
using System.Windows.Media; using System.Windows; using System.Linq; using System.Collections.Generic; public class Main{ /// <summary> /// Creates a copy of a brush with the specified opacity. /// </summary> /// <param name="brush"> /// The brush to copy. /// </param> /// <param name="opacity"> /// The opacity. /// </param> /// <returns> /// </returns> public static Brush ChangeOpacity(Brush brush, double opacity) {/*w w w . j av a 2 s . c om*/ brush = brush.Clone(); brush.Opacity = opacity; return brush; } }