Exemple #1
0
        private void SynthesisButton_Click(object sender, RoutedEventArgs e)
        {
            Element home = grammar.GetImage();

            Clear();
            foreach (Line line in home.Lines)
            {
                drawedElements.Add(TerminalElementCreater.GetTerminalElement(line));
            }
            home.ScaleTransform((WindowGrid.ActualWidth - widthDelta) / home.Length,
                                (WindowGrid.ActualHeight - heightDelta) / home.Height);
            currentGroup = home.GetGeometryGroup();
            UpdateImage();
        }
Exemple #2
0
 private void Image_MouseUp(object sender, MouseButtonEventArgs e)
 {
     if (isDrawingModeEnabled)
     {
         isDrawingModeEnabled = false;
         drawedElements.Add(TerminalElementCreater.GetTerminalElement(new Line(GetCortanianCoordinates(startPoint), GetCortanianCoordinates(e.GetPosition(Image)))));
         currentGroup.Children.Add(new LineGeometry(startPoint, e.GetPosition(Image)));
         UpdateImage();
     }
     else
     {
         isDrawingModeEnabled = true;
         startPoint           = e.GetPosition(Image);
     }
 }