using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace WpfRectangle1 { /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Label L1 = new Label(); L1.Content = "Our Logo with WPF"; RadialGradientBrush rdb1 = new RadialGradientBrush(); rdb1.GradientOrigin = new Point(0.5, 0.5); rdb1.Center = new Point(0.5, 0.5); //setting edages rdb1.RadiusX = 0.5; rdb1.RadiusY = 0.5; //adding stops rdb1.GradientStops.Add(new GradientStop(Colors.Beige, 1.0)); rdb1.GradientStops.Add(new GradientStop(Colors.Bisque, 1.0)); rdb1.GradientStops.Add(new GradientStop(Colors.Maroon, 1.0)); rdb1.GradientStops.Add(new GradientStop(Colors.MediumPurple, 1.0)); //freeze gradient // rdb1.Freeze(); Rectangle rct1 = new Rectangle(); rct1.Width = 50; rct1.Height = 50; rct1.Fill = rdb1; Rectangle rct2 = new Rectangle(); rct2.Width = 200; rct2.Height = 100; rct2.Fill = rdb1; // grid1.Children.Add(rct1); grid2.Children.Add(L1); grid2.Children.Add(rct2); } } }