Set stroke for Ellipse and Line : Ellipse « Windows Presentation Foundation « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Windows Presentation Foundation » Ellipse 
24.85.19.Set stroke for Ellipse and Line
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Shapes;

    public class WheelAndSpokes : Window
    {
        [STAThread]
        public static void Main()
        {
            Application app = new Application();
            app.Run(new WheelAndSpokes());
        }
        public WheelAndSpokes()
        {
            Canvas canv = new Canvas();
            Content = canv;

            Ellipse elips = new Ellipse();
            elips.Stroke = SystemColors.WindowTextBrush;
            elips.Width = 200;
            elips.Height = 200;
            canv.Children.Add(elips);
            Canvas.SetLeft(elips, 300);
            Canvas.SetTop(elips, 50);

            for (int i = 0; i < 72; i++)
            {
                Line line = new Line();
                line.Stroke = SystemColors.WindowTextBrush;
                line.X1 = 0;
                line.Y1 = 0;
                line.X2 = 100;
                line.Y2 = 0;

                line.RenderTransform = new RotateTransform(* i);

                canv.Children.Add(line);
                Canvas.SetLeft(line, 400);
                Canvas.SetTop(line, 150);
            }
        }
    }
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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.