Assign Ellipse shape to window content : Ellipse « Windows Presentation Foundation « C# / CSharp Tutorial






using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;


    class MainClass : Window
    {
        [STAThread]
        public static void Main()
        {
            Application app = new Application();
            app.Run(new MainClass());
        }
        public MainClass()
        {
            Ellipse elips = new Ellipse();
            elips.Fill = Brushes.AliceBlue;
            elips.StrokeThickness = 24;     // 1/4 inch
            elips.Stroke = new LinearGradientBrush(Colors.CadetBlue, Colors.Chocolate,new Point(1, 0), new Point(0, 1));
            Content = elips;
        }
    }








24.85.Ellipse
24.85.1.Ellipse Fill with DrawingBrushEllipse Fill with DrawingBrush
24.85.2.Rectangle and EllipseRectangle and Ellipse
24.85.3.Ellipse With Styled LinesEllipse With Styled Lines
24.85.4.Draws an oval with a blue interiorDraws an oval with a blue interior
24.85.5.Draws an oval with a blue interior and a black outlineDraws an oval with a blue interior and a black outline
24.85.6.Draws a circle with a blue interiorDraws a circle with a blue interior
24.85.7.Draws a circle with a blue interior and a black outlineDraws a circle with a blue interior and a black outline
24.85.8.An ellipse with a radial fillAn ellipse with a radial fill
24.85.9.An ellipse that has been scaled by 20%An ellipse that has been scaled by 20%
24.85.10.The resulting ellipse's outline is painted with an imageThe resulting ellipse's outline is painted with an image
24.85.11.Fill an Ellipse with Cyan and Draw the border with Black colorFill an Ellipse with Cyan and Draw the border with Black color
24.85.12.Ellipse Mouse Down eventEllipse Mouse Down event
24.85.13.Ellipse MouseMove eventEllipse MouseMove event
24.85.14.Ellipse Mouse up eventEllipse Mouse up event
24.85.15.Assign the Ellipse shape which is based on FrameworkElement to window content
24.85.16.Set fill for Ellipse, stroke thickness for Ellipse
24.85.17.Assign Ellipse shape to window content
24.85.18.Adding lines and Ellipse to Canvas
24.85.19.Set stroke for Ellipse and Line