Nt1330 Unit 3 Assignment 1

Words: 171
Pages: 1

//u3125893-Assignment 2-Rahul kadam using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; 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 EllipseDrawing
{
/// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { Color[] colours = new Color[10] {Colors.White, Colors.Yellow, Colors.Green,Colors.LightBlue, Colors.LightGreen, Colors.Blue, Colors.LightGray, Colors.LightPink,
…show more content…
public MainWindow() { InitializeComponent(); } private void canvas_TouchDown(object sender, TouchEventArgs e) { counter = (counter + 1) % 10; elips = new Ellipse(); elips.StrokeThickness = 100; elips.Stroke = new SolidColorBrush(colours[counter]);//Changing colour of ellipse with use of counter

TouchPoint touchPoint = e.GetTouchPoint(canvas); Canvas.SetLeft(elips, touchPoint.Position.X); Canvas.SetRight(elips, touchPoint.Position.X); Canvas.SetTop(elips, touchPoint.Position.Y); Canvas.SetBottom(elips, touchPoint.Position.Y);

movingelip[e.TouchDevice.Id] = elips; canvas.Children.Add(elips); } private void canvas_TouchMove(object sender, TouchEventArgs