Esempio n. 1
0
        public Person(Canvas canvas, Graph graph, Point point, CurrentPerson cp, ToolTip tp)
        {
            image = new Image();
            var img = new BitmapImage();
            img.BeginInit();
            img.UriSource = new Uri("pack://application:,,,/program_final;component/Resources/miku.gif");
            img.EndInit();
            ImageBehavior.SetAnimatedSource(image, img);

            image.MouseLeftButtonUp += Person_MouseLeftButtonUp;
            image.ToolTip = tp;
            ToolTipService.SetInitialShowDelay(image, 0);
            ToolTipService.SetShowDuration(image, 60000);

            canvas.Children.Add(image);
            Canvas.SetZIndex(image, 1);
            point = graph.closestNode(point).getPoint();
            Canvas.SetLeft(image, point.X - 16);
            Canvas.SetTop(image, point.Y - 34);

            this.location = point;
            this.graph = graph;
            this.canvas = canvas;
            this.moving = false;
            this.cp = cp;
        }
Esempio n. 2
0
        public MainWindow()
        {
            InitializeComponent();

            graph = new Graph(new BitmapImage(new Uri("pack://application:,,,/program_final;component/Resources/overlay.png")));
            cp = new Person.CurrentPerson(Clicked_Person);
            tooltip = new ToolTip();
            tooltip.Content = "( LEFT CLICK TO SELECT )\nRIGHT CLICK TO MOVE ( +SHIFT TO QUEUE MOVEMENT )\nKEY A TO ADD ( +SHIFT TO ADD AT MOUSE LOCATION )\nKEY D TO DELETE SELECTED";
            miku = new Person(canvas, graph, new Point(18, 36), new Person.CurrentPerson(cp), tooltip);

            points = new List<Point>();
        }